提交 ba1b5c44 编写于 作者: S Sudip Mukherjee 提交者: Greg Kroah-Hartman

misc: mic: return error properly

If request_firmware() succeeds then rc becomes 0. After that if the test
for strcmp() fails then we were jumping to label done: and returning rc.
But rc being 0 we returned success whereas we have failed here and we
were supposed to return an error.
Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: NSudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d897d7ed
...@@ -468,8 +468,13 @@ mic_x100_load_firmware(struct mic_device *mdev, const char *buf) ...@@ -468,8 +468,13 @@ mic_x100_load_firmware(struct mic_device *mdev, const char *buf)
} }
memcpy_toio(mdev->aper.va + mdev->bootaddr, fw->data, fw->size); memcpy_toio(mdev->aper.va + mdev->bootaddr, fw->data, fw->size);
mdev->ops->write_spad(mdev, MIC_X100_FW_SIZE, fw->size); mdev->ops->write_spad(mdev, MIC_X100_FW_SIZE, fw->size);
if (!strcmp(mdev->cosm_dev->bootmode, "flash")) if (!strcmp(mdev->cosm_dev->bootmode, "flash")) {
rc = -EINVAL;
dev_err(&mdev->pdev->dev, "%s %d rc %d\n",
__func__, __LINE__, rc);
release_firmware(fw);
goto done; goto done;
}
/* load command line */ /* load command line */
rc = mic_x100_load_command_line(mdev, fw); rc = mic_x100_load_command_line(mdev, fw);
if (rc) { if (rc) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册