mptfusion: remove redundant kfree checks
authorJoe Lawrence <joe.lawrence@stratus.com>
Wed, 25 Jun 2014 21:06:02 +0000 (17:06 -0400)
committerChristoph Hellwig <hch@lst.de>
Fri, 25 Jul 2014 21:16:57 +0000 (17:16 -0400)
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>
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptspi.c

index bf2a2ce..d8bf84a 100644 (file)
@@ -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;
 }
 
index 7b4db9a..787933d 100644 (file)
@@ -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;
 }