Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1243904

Re: [PATCH] staging: r8188eu: Add _enter_critical_mutex() error handling

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: r8188eu: Add _enter_critical_mutex() error handling
Date 2015-10-10 17:10 +0200
Message-ID <qi3Wx-4wl-3@gated-at.bofh.it> (permalink)
References <qhOut-7eA-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Oct 10, 2015 at 01:37:47AM +0300, Alexey Khoroshilov wrote:
> _enter_critical_mutex() is a simple call to mutex_lock_interruptible(),
> but there is no error handling code for it.
> 
> The patch removes wrapper _enter_critical_mutex() and
> adds error handling for mutex_lock_interruptible().
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> ---
>  drivers/staging/rtl8188eu/core/rtw_mlme_ext.c     | 5 +++--
>  drivers/staging/rtl8188eu/include/osdep_service.h | 9 ---------
>  drivers/staging/rtl8188eu/os_dep/os_intfs.c       | 3 ++-
>  drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c  | 5 ++++-
>  4 files changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> index 935b48eef8b1..4e9312f0e902 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> @@ -271,7 +271,8 @@ static s32 dump_mgntframe_and_wait_ack(struct adapter *padapter,
>  	if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
>  		return -1;
>  
> -	_enter_critical_mutex(&pxmitpriv->ack_tx_mutex, NULL);
> +	if (!mutex_lock_interruptible(&pxmitpriv->ack_tx_mutex))
> +		return _FAIL;

This is reversed.  mutex_lock_interruptible() returns -EINTR on failure.
The rest of this patch is correct.

regards,
dan carpenter


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] staging: r8188eu: Add _enter_critical_mutex() error handling Alexey Khoroshilov <khoroshilov@ispras.ru> - 2015-10-10 00:40 +0200
  Re: [PATCH] staging: r8188eu: Add _enter_critical_mutex() error  handling Dan Carpenter <dan.carpenter@oracle.com> - 2015-10-10 17:10 +0200
    [PATCH v2] staging: r8188eu: Add _enter_critical_mutex() error handling Alexey Khoroshilov <khoroshilov@ispras.ru> - 2015-10-17 23:40 +0200

csiph-web