2015-08-19 11:08:52

by Michal Kazior

[permalink] [raw]
Subject: [PATCH] ath10k: add missing mutex unlock on failpath

Kernel would complain about leaving a held lock
after going back to userspace and would
subsequently deadlock.

Fixes: e04cafbc38c7 ("ath10k: fix peer limit enforcement")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Michal Kazior <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 9bca37820848..64674c955d44 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4144,7 +4144,8 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,

if (ar->num_peers >= ar->max_num_peers) {
ath10k_warn(ar, "refusing vdev creation due to insufficient peer entry resources in firmware\n");
- return -ENOBUFS;
+ ret = -ENOBUFS;
+ goto err;
}

if (ar->free_vdev_map == 0) {
--
2.1.4



2015-08-26 08:06:48

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath10k: add missing mutex unlock on failpath

Michal Kazior <[email protected]> writes:

> Kernel would complain about leaving a held lock
> after going back to userspace and would
> subsequently deadlock.
>
> Fixes: e04cafbc38c7 ("ath10k: fix peer limit enforcement")
> Reported-by: Dan Carpenter <[email protected]>
> Signed-off-by: Michal Kazior <[email protected]>

Thanks, applied.

--
Kalle Valo

2015-08-19 11:28:21

by Michal Kazior

[permalink] [raw]
Subject: Re: [PATCH] ath10k: add missing mutex unlock on failpath

On 19 August 2015 at 13:23, Kalle Valo <[email protected]> wrote:
> Michal Kazior <[email protected]> writes:
>
>> Kernel would complain about leaving a held lock
>> after going back to userspace and would
>> subsequently deadlock.
>>
>> Fixes: e04cafbc38c7 ("ath10k: fix peer limit enforcement")
>> Reported-by: Dan Carpenter <[email protected]>
>> Signed-off-by: Michal Kazior <[email protected]>
>
> commit e04cafbc38c7 is currently going to 4.3-rc1 (it's in
> wireless-drivers-next currently). I think we should send this to 4.3 as
> well, right?

It does make sense to do so, yes.


MichaƂ

2015-08-19 11:23:48

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath10k: add missing mutex unlock on failpath

Michal Kazior <[email protected]> writes:

> Kernel would complain about leaving a held lock
> after going back to userspace and would
> subsequently deadlock.
>
> Fixes: e04cafbc38c7 ("ath10k: fix peer limit enforcement")
> Reported-by: Dan Carpenter <[email protected]>
> Signed-off-by: Michal Kazior <[email protected]>

commit e04cafbc38c7 is currently going to 4.3-rc1 (it's in
wireless-drivers-next currently). I think we should send this to 4.3 as
well, right?

--
Kalle Valo