]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pm8001: fix update_flash
authorTomas Henzl <thenzl@redhat.com>
Mon, 7 Jul 2014 15:19:59 +0000 (17:19 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 25 Jul 2014 21:17:05 +0000 (17:17 -0400)
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>
drivers/scsi/pm8001/pm8001_ctl.c

index ade62c8a19fa54e434d3f9098fb9b43a89a97715..d3a08aea09487e955d51b394b300826183b5c296 100644 (file)
@@ -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;
                }
        }