Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5074b1b6 authored by Joe Lawrence's avatar Joe Lawrence Committed by Christoph Hellwig
Browse files

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: default avatarJoe Lawrence <joe.lawrence@stratus.com>
Acked-by: default avatarSreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 5767d25f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -525,7 +525,6 @@ mptfc_target_destroy(struct scsi_target *starget)
		if (ri)	/* better be! */
			ri->starget = NULL;
	}
	if (starget->hostdata)
	kfree(starget->hostdata);
	starget->hostdata = NULL;
}
+1 −2
Original line number Diff line number Diff line
@@ -461,7 +461,6 @@ static int mptspi_target_alloc(struct scsi_target *starget)
static void
mptspi_target_destroy(struct scsi_target *starget)
{
	if (starget->hostdata)
	kfree(starget->hostdata);
	starget->hostdata = NULL;
}