Re: [PATCH] intel-ish-hid: Fix a use after free in load_fw_from_host()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 26 Jun 2019, Dan Carpenter wrote:

> 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@xxxxxxxxxx>
> ---
>  drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;

Applied, thanks Dan.

-- 
Jiri Kosina
SUSE Labs




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux