mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
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: Joe Lawrence <joe.lawrence@stratus.com> Acked-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
5767d25f0d
commit
5074b1b60e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user