Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Lawrence and committed by
Christoph Hellwig
5074b1b6 5767d25f

+2 -4
+1 -2
drivers/message/fusion/mptfc.c
··· 525 525 if (ri) /* better be! */ 526 526 ri->starget = NULL; 527 527 } 528 - if (starget->hostdata) 529 - kfree(starget->hostdata); 528 + kfree(starget->hostdata); 530 529 starget->hostdata = NULL; 531 530 } 532 531
+1 -2
drivers/message/fusion/mptspi.c
··· 461 461 static void 462 462 mptspi_target_destroy(struct scsi_target *starget) 463 463 { 464 - if (starget->hostdata) 465 - kfree(starget->hostdata); 464 + kfree(starget->hostdata); 466 465 starget->hostdata = NULL; 467 466 } 468 467