Skip to content

Commit 5074b1b

Browse files
Joe LawrenceChristoph Hellwig
authored andcommitted
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>
1 parent 5767d25 commit 5074b1b

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/message/fusion/mptfc.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,7 @@ mptfc_target_destroy(struct scsi_target *starget)
525525
if (ri) /* better be! */
526526
ri->starget = NULL;
527527
}
528-
if (starget->hostdata)
529-
kfree(starget->hostdata);
528+
kfree(starget->hostdata);
530529
starget->hostdata = NULL;
531530
}
532531

‎drivers/message/fusion/mptspi.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,7 @@ static int mptspi_target_alloc(struct scsi_target *starget)
461461
static void
462462
mptspi_target_destroy(struct scsi_target *starget)
463463
{
464-
if (starget->hostdata)
465-
kfree(starget->hostdata);
464+
kfree(starget->hostdata);
466465
starget->hostdata = NULL;
467466
}
468467

0 commit comments

Comments
 (0)