RE: [PATCH -next] platform/x86: dell-smbios-wmi: fix missing unlock on error in dell_smbios_wmi_call()

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

 



> -----Original Message-----
> From: platform-driver-x86-owner@xxxxxxxxxxxxxxx [mailto:platform-driver-x86-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Wei Yongjun
> Sent: Tuesday, November 14, 2017 12:58 AM
> To: Limonciello, Mario <Mario_Limonciello@xxxxxxxx>; Darren Hart
> <dvhart@xxxxxxxxxxxxx>; Andy Shevchenko <andy@xxxxxxxxxxxxx>
> Cc: Wei Yongjun <weiyongjun1@xxxxxxxxxx>; platform-driver-
> x86@xxxxxxxxxxxxxxx
> Subject: [PATCH -next] platform/x86: dell-smbios-wmi: fix missing unlock on error
> in dell_smbios_wmi_call()
> 
> Add the missing unlock before return from function dell_smbios_wmi_call()
> in the error handling case.
> 
> Fixes: 1a258e670434 ("platform/x86: dell-smbios-wmi: Add new WMI dispatcher
> driver")
> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> ---
>  drivers/platform/x86/dell-smbios-wmi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/dell-smbios-wmi.c b/drivers/platform/x86/dell-
> smbios-wmi.c
> index 35c13815..04da5a7 100644
> --- a/drivers/platform/x86/dell-smbios-wmi.c
> +++ b/drivers/platform/x86/dell-smbios-wmi.c
> @@ -91,8 +91,10 @@ int dell_smbios_wmi_call(struct calling_interface_buffer
> *buffer)
> 
>  	mutex_lock(&call_mutex);
>  	priv = get_first_smbios_priv();
> -	if (!priv)
> +	if (!priv) {
> +		mutex_unlock(&call_mutex);
>  		return -ENODEV;
> +	}
> 
>  	size = sizeof(struct calling_interface_buffer);
>  	difference = priv->req_buf_size - sizeof(u64) - size;

Thanks Wei.  This is already fixed in -next:
http://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git/commit/307ab2a99d190d3a7949258b8551b66887ce8cf4

Thanks,




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux