We need to unlock if mwifiex_usb_prepare_tx_aggr_skb() fails.
Fixes: a2ca85ad721d ("mwifiex: usb: add timer to flush aggregation packets")
Signed-off-by: Dan Carpenter <[email protected]>
diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
index cb1753e43ef4..880ef1cb4088 100644
--- a/drivers/net/wireless/marvell/mwifiex/usb.c
+++ b/drivers/net/wireless/marvell/mwifiex/usb.c
@@ -1112,7 +1112,7 @@ static void mwifiex_usb_tx_aggr_tmo(unsigned long context)
if (err) {
mwifiex_dbg(adapter, ERROR,
"prepare tx aggr skb failed, err=%d\n", err);
- return;
+ goto unlock;
}
if (atomic_read(&port->tx_data_urb_pending) >=
@@ -1133,6 +1133,7 @@ static void mwifiex_usb_tx_aggr_tmo(unsigned long context)
done:
if (err == -1)
mwifiex_write_data_complete(adapter, skb_send, 0, -1);
+unlock:
spin_unlock_irqrestore(&port->tx_aggr_lock, flags);
}
SGksDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogRGFuIENhcnBlbnRl
ciBbbWFpbHRvOmRhbi5jYXJwZW50ZXJAb3JhY2xlLmNvbV0NCj4gU2VudDogMjAxN8TqN9TCMTDI
1SAxNToyMQ0KPiBUbzogQW1pdGt1bWFyIEthcndhcjsgWGlubWluZyBIdQ0KPiBDYzogTmlzaGFu
dCBTYXJtdWthZGFtOyBHYW5hcGF0aGkgQmhhdDsgS2FsbGUgVmFsbzsNCj4gbGludXgtd2lyZWxl
c3NAdmdlci5rZXJuZWwub3JnOyBrZXJuZWwtamFuaXRvcnNAdmdlci5rZXJuZWwub3JnDQo+IFN1
YmplY3Q6IFtFWFRdIFtQQVRDSF0gbXdpZmlleDogdXNiOiB1bmxvY2sgb24gZXJyb3IgaW4NCj4g
bXdpZmlleF91c2JfdHhfYWdncl90bW8oKQ0KPiANCj4gRXh0ZXJuYWwgRW1haWwNCj4gDQo+IC0t
LS0tLS0tLS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NfcmVhZCgmcG9y
dC0+dHhfZGF0YV91cmJfcGVuZGluZykgPj0gQEAgLTExMzMsNiArMTEzMyw3DQo+IEBAIHN0YXRp
YyB2b2lkIG13aWZpZXhfdXNiX3R4X2FnZ3JfdG1vKHVuc2lnbmVkIGxvbmcgY29udGV4dCkNCj4g
IGRvbmU6DQo+ICAJaWYgKGVyciA9PSAtMSkNCj4gIAkJbXdpZmlleF93cml0ZV9kYXRhX2NvbXBs
ZXRlKGFkYXB0ZXIsIHNrYl9zZW5kLCAwLCAtMSk7DQo+ICt1bmxvY2s6DQo+ICAJc3Bpbl91bmxv
Y2tfaXJxcmVzdG9yZSgmcG9ydC0+dHhfYWdncl9sb2NrLCBmbGFncyk7ICB9DQo+IA0KDQpDaGFu
Z2UgbG9va3MgZmluZSB0byBtZS4gVGhhbmtzLg0KDQpSZWdhcmRzLA0KU2ltb24NCg==
Dan Carpenter <[email protected]> wrote:
> We need to unlock if mwifiex_usb_prepare_tx_aggr_skb() fails.
>
> Fixes: a2ca85ad721d ("mwifiex: usb: add timer to flush aggregation packets")
> Signed-off-by: Dan Carpenter <[email protected]>
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
> index cb1753e43ef4..880ef1cb4088 100644
> --- a/drivers/net/wireless/marvell/mwifiex/usb.c
> +++ b/drivers/net/wireless/marvell/mwifiex/usb.c
> @@ -1112,7 +1112,7 @@ static void mwifiex_usb_tx_aggr_tmo(unsigned long context)
> if (err) {
> mwifiex_dbg(adapter, ERROR,
> "prepare tx aggr skb failed, err=%d\n", err);
> - return;
> + goto unlock;
> }
>
> if (atomic_read(&port->tx_data_urb_pending) >=
> @@ -1133,6 +1133,7 @@ static void mwifiex_usb_tx_aggr_tmo(unsigned long context)
> done:
> if (err == -1)
> mwifiex_write_data_complete(adapter, skb_send, 0, -1);
> +unlock:
> spin_unlock_irqrestore(&port->tx_aggr_lock, flags);
> }
Patch applied to wireless-drivers-next.git, thanks.
fe0c94be77a0 mwifiex: usb: unlock on error in mwifiex_usb_tx_aggr_tmo()
--
https://patchwork.kernel.org/patch/9832397/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches