提交 5074b1b6 编写于 作者: J Joe Lawrence 提交者: Christoph Hellwig

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: NJoe Lawrence <joe.lawrence@stratus.com>
Acked-by: NSreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 5767d25f
...@@ -525,7 +525,6 @@ mptfc_target_destroy(struct scsi_target *starget) ...@@ -525,7 +525,6 @@ mptfc_target_destroy(struct scsi_target *starget)
if (ri) /* better be! */ if (ri) /* better be! */
ri->starget = NULL; ri->starget = NULL;
} }
if (starget->hostdata)
kfree(starget->hostdata); kfree(starget->hostdata);
starget->hostdata = NULL; starget->hostdata = NULL;
} }
......
...@@ -461,7 +461,6 @@ static int mptspi_target_alloc(struct scsi_target *starget) ...@@ -461,7 +461,6 @@ static int mptspi_target_alloc(struct scsi_target *starget)
static void static void
mptspi_target_destroy(struct scsi_target *starget) mptspi_target_destroy(struct scsi_target *starget)
{ {
if (starget->hostdata)
kfree(starget->hostdata); kfree(starget->hostdata);
starget->hostdata = NULL; starget->hostdata = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册