From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Larry Finger <Larry.Finger@lwfinger.net>,
devel@driverdev.osuosl.org, ldv-project@linuxtesting.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: r8188eu: Add _enter_critical_mutex() error handling
Date: Sat, 10 Oct 2015 18:04:34 +0300 [thread overview]
Message-ID: <20151010140448.GW7340@mwanda> (raw)
In-Reply-To: <1444430267-11421-1-git-send-email-khoroshilov@ispras.ru>
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
next prev parent reply other threads:[~2015-10-10 15:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 22:37 [PATCH] staging: r8188eu: Add _enter_critical_mutex() error handling Alexey Khoroshilov
2015-10-10 15:04 ` Dan Carpenter [this message]
2015-10-17 21:33 ` [PATCH v2] " Alexey Khoroshilov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151010140448.GW7340@mwanda \
--to=dan.carpenter@oracle.com \
--cc=Larry.Finger@lwfinger.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=khoroshilov@ispras.ru \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox