summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/host/mic_x100.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-11-23 17:24:30 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 22:53:40 -0800
commitba1b5c44e2a9fed6f97fb10da3b4da164d4a26e4 (patch)
tree0da1d8aeb9a9eb816b36d9042caa8cc6b8103d90 /drivers/misc/mic/host/mic_x100.c
parentd897d7edee8eaf0a8f7924a9502fd68e72041f8c (diff)
downloadlinux-ba1b5c44e2a9fed6f97fb10da3b4da164d4a26e4.tar.gz
linux-ba1b5c44e2a9fed6f97fb10da3b4da164d4a26e4.tar.bz2
linux-ba1b5c44e2a9fed6f97fb10da3b4da164d4a26e4.zip
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: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic/host/mic_x100.c')
-rw-r--r--drivers/misc/mic/host/mic_x100.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/misc/mic/host/mic_x100.c b/drivers/misc/mic/host/mic_x100.c
index cd5208d1895d..317e25ff484c 100644
--- a/drivers/misc/mic/host/mic_x100.c
+++ b/drivers/misc/mic/host/mic_x100.c
@@ -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);
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;
+ }
/* load command line */
rc = mic_x100_load_command_line(mdev, fw);
if (rc) {