* [PATCH] staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit()
@ 2018-07-05 3:48 Ajay Singh
2018-07-05 8:41 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Ajay Singh @ 2018-07-05 3:48 UTC (permalink / raw)
To: linux-wireless
Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
claudiu.beznea, adham.abozaeid, Ajay Singh
Fix for static checker warning inconsistent returns of
'hif_deinit_lock'(more details [1]).
"drivers/staging/wilc1000/host_interface.c:3390 wilc_deinit()
warn: inconsistent returns 'hif_deinit_lock'."
Introduced in "ff52a57a7a42: staging: wilc1000: move the allocation of
cmd out of wilc_enqueue_cmd()".
[1]. https://www.spinics.net/lists/linux-driver-devel/msg114216.html
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/host_interface.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 52c0c10..918d06e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3370,15 +3370,15 @@ int wilc_deinit(struct wilc_vif *vif)
struct host_if_msg *msg;
msg = wilc_alloc_work(vif, handle_hif_exit_work, true);
- if (IS_ERR(msg))
- return PTR_ERR(msg);
-
- result = wilc_enqueue_work(msg);
- if (result)
- netdev_err(vif->ndev, "deinit : Error(%d)\n", result);
- else
- wait_for_completion(&msg->work_comp);
- kfree(msg);
+ if (!IS_ERR(msg)) {
+ result = wilc_enqueue_work(msg);
+ if (result)
+ netdev_err(vif->ndev, "deinit : Error(%d)\n",
+ result);
+ else
+ wait_for_completion(&msg->work_comp);
+ kfree(msg);
+ }
destroy_workqueue(hif_workqueue);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit()
2018-07-05 3:48 [PATCH] staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit() Ajay Singh
@ 2018-07-05 8:41 ` Dan Carpenter
2018-07-05 9:19 ` Ajay Singh
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2018-07-05 8:41 UTC (permalink / raw)
To: Ajay Singh
Cc: linux-wireless, devel, venkateswara.kaja, gregkh, ganesh.krishna,
adham.abozaeid, aditya.shankar
On Thu, Jul 05, 2018 at 09:18:53AM +0530, Ajay Singh wrote:
> Fix for static checker warning inconsistent returns of
> 'hif_deinit_lock'(more details [1]).
>
> "drivers/staging/wilc1000/host_interface.c:3390 wilc_deinit()
> warn: inconsistent returns 'hif_deinit_lock'."
>
> Introduced in "ff52a57a7a42: staging: wilc1000: move the allocation of
> cmd out of wilc_enqueue_cmd()".
Can you use the Fixes tag so it's machine parseable?
Fixes: ff52a57a7a42 ("staging: wilc1000: move the allocation of cmd out of wilc_enqueue_cmd()")
With the fixes tag, say someone pulls ff52a57a7a42 into their code, they
will know to pull this patch as well. Also scientists will be able to
measure the time between bug and fix and write a scholarly paper about
it.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit()
2018-07-05 8:41 ` Dan Carpenter
@ 2018-07-05 9:19 ` Ajay Singh
0 siblings, 0 replies; 3+ messages in thread
From: Ajay Singh @ 2018-07-05 9:19 UTC (permalink / raw)
To: Dan Carpenter
Cc: linux-wireless, devel, venkateswara.kaja, gregkh, ganesh.krishna,
adham.abozaeid, aditya.shankar
Hi Dan,
On Thu, 5 Jul 2018 11:41:26 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Thu, Jul 05, 2018 at 09:18:53AM +0530, Ajay Singh wrote:
> > Fix for static checker warning inconsistent returns of
> > 'hif_deinit_lock'(more details [1]).
> >
> > "drivers/staging/wilc1000/host_interface.c:3390 wilc_deinit()
> > warn: inconsistent returns 'hif_deinit_lock'."
> >
> > Introduced in "ff52a57a7a42: staging: wilc1000: move the allocation
> > of cmd out of wilc_enqueue_cmd()".
>
> Can you use the Fixes tag so it's machine parseable?
>
> Fixes: ff52a57a7a42 ("staging: wilc1000: move the allocation of cmd
> out of wilc_enqueue_cmd()")
Thanks for your suggestion.
Will include the 'Fixes' tag and submit patch v2 version.
>
> With the fixes tag, say someone pulls ff52a57a7a42 into their code,
> they will know to pull this patch as well. Also scientists will be
> able to measure the time between bug and fix and write a scholarly
> paper about it.
>
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-05 10:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-05 3:48 [PATCH] staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit() Ajay Singh
2018-07-05 8:41 ` Dan Carpenter
2018-07-05 9:19 ` Ajay Singh
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).