* [PATCH net-next] ieee802154: hwsim: fix missing unlock on error in hwsim_add_one()
@ 2018-08-08 3:10 Wei Yongjun
2018-08-08 20:06 ` Stefan Schmidt
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2018-08-08 3:10 UTC (permalink / raw)
To: Alexander Aring, Stefan Schmidt
Cc: Wei Yongjun, linux-wpan, netdev, kernel-janitors
Add the missing unlock before return from function hwsim_add_one()
in the error handling case.
Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/net/ieee802154/mac802154_hwsim.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
index f4e9205..44d398c 100644
--- a/drivers/net/ieee802154/mac802154_hwsim.c
+++ b/drivers/net/ieee802154/mac802154_hwsim.c
@@ -810,8 +810,10 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
mutex_lock(&hwsim_phys_lock);
if (init) {
err = hwsim_subscribe_all_others(phy);
- if (err < 0)
+ if (err < 0) {
+ mutex_unlock(&hwsim_phys_lock);
goto err_reg;
+ }
}
list_add_tail(&phy->list, &hwsim_phys);
mutex_unlock(&hwsim_phys_lock);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] ieee802154: hwsim: fix missing unlock on error in hwsim_add_one()
2018-08-08 3:10 [PATCH net-next] ieee802154: hwsim: fix missing unlock on error in hwsim_add_one() Wei Yongjun
@ 2018-08-08 20:06 ` Stefan Schmidt
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Schmidt @ 2018-08-08 20:06 UTC (permalink / raw)
To: Wei Yongjun, Alexander Aring; +Cc: linux-wpan, netdev, kernel-janitors
Hello Wei.
On 08/08/2018 05:10 AM, Wei Yongjun wrote:
> Add the missing unlock before return from function hwsim_add_one()
> in the error handling case.
>
> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/net/ieee802154/mac802154_hwsim.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
> index f4e9205..44d398c 100644
> --- a/drivers/net/ieee802154/mac802154_hwsim.c
> +++ b/drivers/net/ieee802154/mac802154_hwsim.c
> @@ -810,8 +810,10 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
> mutex_lock(&hwsim_phys_lock);
> if (init) {
> err = hwsim_subscribe_all_others(phy);
> - if (err < 0)
> + if (err < 0) {
> + mutex_unlock(&hwsim_phys_lock);
> goto err_reg;
> + }
> }
> list_add_tail(&phy->list, &hwsim_phys);
> mutex_unlock(&hwsim_phys_lock);
>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
regards
Stefan Schmidt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-08 22:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-08 3:10 [PATCH net-next] ieee802154: hwsim: fix missing unlock on error in hwsim_add_one() Wei Yongjun
2018-08-08 20:06 ` Stefan Schmidt
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).