Skip to content

Commit

Permalink
mptfusion: remove redundant kfree checks
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Sreekanth Reddy <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
Joe Lawrence authored and Christoph Hellwig committed Jul 25, 2014
1 parent 5767d25 commit 5074b1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions drivers/message/fusion/mptfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/message/fusion/mptspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5074b1b

Please sign in to comment.