Skip to content

Commit

Permalink
HID: intel-ish-hid: Fix a use after free in load_fw_from_host()
Browse files Browse the repository at this point in the history
We have to print the filename first before we can kfree it.

Fixes: 91b2281 ("HID: intel-ish-hid: ISH firmware loader client driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Dan Carpenter authored and Jiri Kosina committed Jun 26, 2019
1 parent 3ed224e commit 21acee4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/intel-ish-hid/ishtp-fw-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,9 @@ static int load_fw_from_host(struct ishtp_cl_data *client_data)
goto end_err_fw_release;

release_firmware(fw);
kfree(filename);
dev_info(cl_data_to_dev(client_data), "ISH firmware %s loaded\n",
filename);
kfree(filename);
return 0;

end_err_fw_release:
Expand Down

0 comments on commit 21acee4

Please sign in to comment.