提交 31d05e5b 编写于 作者: T Tomas Henzl 提交者: Christoph Hellwig

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: NTomas Henzl <thenzl@redhat.com>
Acked-by: NSuresh Thiagarajan <Suresh.Thiagarajan@pmcs.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 9422e864
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册