]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
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 bf2a2cef562bed6bdfe71a8945f308d0bb2bb478..d8bf84aef602d0f959641aea2e501f213837fca3 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 7b4db9acf7d75d43f8d95ad32fe9116939b3a763..787933d43d3217954eb95364fbea3cff9a7870dd 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;
 }