Commit 5074b1b6 authored by Joe Lawrence's avatar Joe Lawrence Committed by Christoph Hellwig

mptfusion: remove redundant kfree checks

Fixes the following smatch warnings:

  drivers/message/fusion/mptfc.c:529 mptfc_target_destroy() info:
    redundant null check on starget->hostdata calling kfree()

  drivers/message/fusion/mptspi.c:465 mptspi_target_destroy() info:
    redundant null check on starget->hostdata calling kfree()
Signed-off-by: default avatarJoe Lawrence <joe.lawrence@stratus.com>
Acked-by: default avatarSreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 5767d25f
......@@ -525,8 +525,7 @@ mptfc_target_destroy(struct scsi_target *starget)
if (ri) /* better be! */
ri->starget = NULL;
}
if (starget->hostdata)
kfree(starget->hostdata);
kfree(starget->hostdata);
starget->hostdata = NULL;
}
......
......@@ -461,8 +461,7 @@ static int mptspi_target_alloc(struct scsi_target *starget)
static void
mptspi_target_destroy(struct scsi_target *starget)
{
if (starget->hostdata)
kfree(starget->hostdata);
kfree(starget->hostdata);
starget->hostdata = NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment