* [PATCH] staging: wfx: unlock on error path
@ 2020-05-12 8:36 Dan Carpenter
2020-05-12 9:03 ` Jérôme Pouiller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-05-12 8:36 UTC (permalink / raw)
To: Jérôme Pouiller; +Cc: devel, Greg Kroah-Hartman, kernel-janitors
We need to release the tx_lock on the error path before returning.
Fixes: d1c015b4ef6f ("staging: wfx: rewrite wfx_hw_scan()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
From static analysis. Not tested.
drivers/staging/wfx/scan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
index 76761e4960dd7..eff1be9fb28f8 100644
--- a/drivers/staging/wfx/scan.c
+++ b/drivers/staging/wfx/scan.c
@@ -57,8 +57,10 @@ static int send_scan_req(struct wfx_vif *wvif,
wvif->scan_abort = false;
reinit_completion(&wvif->scan_complete);
timeout = hif_scan(wvif, req, start_idx, i - start_idx);
- if (timeout < 0)
+ if (timeout < 0) {
+ wfx_tx_unlock(wvif->wdev);
return timeout;
+ }
ret = wait_for_completion_timeout(&wvif->scan_complete, timeout);
if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower)
hif_set_output_power(wvif, wvif->vif->bss_conf.txpower);
--
2.26.2
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: wfx: unlock on error path
2020-05-12 8:36 [PATCH] staging: wfx: unlock on error path Dan Carpenter
@ 2020-05-12 9:03 ` Jérôme Pouiller
0 siblings, 0 replies; 2+ messages in thread
From: Jérôme Pouiller @ 2020-05-12 9:03 UTC (permalink / raw)
To: Dan Carpenter; +Cc: devel, Greg Kroah-Hartman, kernel-janitors
On Tuesday 12 May 2020 10:36:56 CEST Dan Carpenter wrote:
>
> We need to release the tx_lock on the error path before returning.
>
> Fixes: d1c015b4ef6f ("staging: wfx: rewrite wfx_hw_scan()")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> From static analysis. Not tested.
>
> drivers/staging/wfx/scan.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
> index 76761e4960dd7..eff1be9fb28f8 100644
> --- a/drivers/staging/wfx/scan.c
> +++ b/drivers/staging/wfx/scan.c
> @@ -57,8 +57,10 @@ static int send_scan_req(struct wfx_vif *wvif,
> wvif->scan_abort = false;
> reinit_completion(&wvif->scan_complete);
> timeout = hif_scan(wvif, req, start_idx, i - start_idx);
> - if (timeout < 0)
> + if (timeout < 0) {
> + wfx_tx_unlock(wvif->wdev);
> return timeout;
> + }
> ret = wait_for_completion_timeout(&wvif->scan_complete, timeout);
> if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower)
> hif_set_output_power(wvif, wvif->vif->bss_conf.txpower);
> --
> 2.26.2
>
>
Good catch!
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
--
Jérôme Pouiller
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-12 9:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 8:36 [PATCH] staging: wfx: unlock on error path Dan Carpenter
2020-05-12 9:03 ` Jérôme Pouiller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).