From: Ajay Singh <ajay.kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <gregkh@linuxfoundation.org>,
<ganesh.krishna@microchip.com>, <venkateswara.kaja@microchip.com>,
<aditya.shankar@microchip.com>, <claudiu.beznea@microchip.com>,
<adham.abozaeid@Microchip.com>,
Ajay Singh <ajay.kathat@microchip.com>
Subject: [PATCH v2] staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit()
Date: Thu, 5 Jul 2018 14:52:35 +0530 [thread overview]
Message-ID: <1530782555-31493-1-git-send-email-ajay.kathat@microchip.com> (raw)
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'."
Fixes: 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>
---
Change since v1:
- added 'Fixes' tag in commit description.
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
reply other threads:[~2018-07-05 11:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1530782555-31493-1-git-send-email-ajay.kathat@microchip.com \
--to=ajay.kathat@microchip.com \
--cc=adham.abozaeid@Microchip.com \
--cc=aditya.shankar@microchip.com \
--cc=claudiu.beznea@microchip.com \
--cc=devel@driverdev.osuosl.org \
--cc=ganesh.krishna@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-wireless@vger.kernel.org \
--cc=venkateswara.kaja@microchip.com \
/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;
as well as URLs for NNTP newsgroup(s).