Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pm8001: fix update_flash

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>

authored by

Tomas Henzl and committed by
Christoph Hellwig
31d05e5b 9422e864

+3 -3
+3 -3
drivers/scsi/pm8001/pm8001_ctl.c
··· 617 617 618 618 pm8001_ha->nvmd_completion = &completion; 619 619 ret = PM8001_CHIP_DISP->fw_flash_update_req(pm8001_ha, payload); 620 + if (ret) 621 + break; 620 622 wait_for_completion(&completion); 621 - if (ret || (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS)) { 623 + if (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS) { 622 624 ret = fwControl->retcode; 623 - kfree(ioctlbuffer); 624 - ioctlbuffer = NULL; 625 625 break; 626 626 } 627 627 }