Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba1b5c44 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Greg Kroah-Hartman
Browse files

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: default avatarSudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: default avatarSudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d897d7ed
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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) {