aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000
diff options
context:
space:
mode:
authorAjay Singh <ajay.kathat@microchip.com>2018-07-05 14:52:35 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-06 17:37:31 +0200
commit15c3381e3abba34c8634575305db1e414e587e3b (patch)
tree72847777d09dc401fcea22afb0ff5b51de31b9cf /drivers/staging/wilc1000
parentstaging: rtl8188eu: remove rtw_mp_phy_regdef.h (diff)
downloadlinux-dev-15c3381e3abba34c8634575305db1e414e587e3b.tar.xz
linux-dev-15c3381e3abba34c8634575305db1e414e587e3b.zip
staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit()
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r--drivers/staging/wilc1000/host_interface.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 52c0c1066375..918d06e8cd34 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);
}