summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-06-26 13:10:41 +0300
committerJiri Kosina <jkosina@suse.cz>2019-06-26 13:30:16 +0200
commit21acee4ecf9c3d9eff545f50e79c321a0c35d9b3 (patch)
treef156ae42e55bfe41f495b65cda3b40120eed628f /drivers/hid
parent3ed224e273ac5880eeab4c3043a6b06b0478dd56 (diff)
downloadlwn-21acee4ecf9c3d9eff545f50e79c321a0c35d9b3.tar.gz
lwn-21acee4ecf9c3d9eff545f50e79c321a0c35d9b3.zip
HID: intel-ish-hid: Fix a use after free in load_fw_from_host()
We have to print the filename first before we can kfree it. Fixes: 91b228107da3 ("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>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/intel-ish-hid/ishtp-fw-loader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
index 22ba21457035..aa2dbed30fc3 100644
--- a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
+++ b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
@@ -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: