Skip to content

Commit

Permalink
pm8001: fix update_flash
Browse files Browse the repository at this point in the history
The driver checks the return valu, but after he tries to wait_for_completion
which might never happen.  Also the ioctl buffer is freed at the end of the
function, so the first removal is not needed.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Acked-by: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Tomas Henzl authored and Christoph Hellwig committed Jul 25, 2014
1 parent 9422e86 commit 31d05e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/scsi/pm8001/pm8001_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,11 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha)

pm8001_ha->nvmd_completion = &completion;
ret = PM8001_CHIP_DISP->fw_flash_update_req(pm8001_ha, payload);
if (ret)
break;
wait_for_completion(&completion);
if (ret || (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS)) {
if (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS) {
ret = fwControl->retcode;
kfree(ioctlbuffer);
ioctlbuffer = NULL;
break;
}
}
Expand Down

0 comments on commit 31d05e5

Please sign in to comment.