diff mbox

mwifiex: usb: unlock on error in mwifiex_usb_tx_aggr_tmo()

Message ID 20170710072115.2y4ukbl7x4rk4bac@mwanda (mailing list archive)
State Accepted
Commit fe0c94be77a0b69456d6a35c838ee23d68204ba2
Delegated to: Kalle Valo
Headers show

Commit Message

Dan Carpenter July 10, 2017, 7:21 a.m. UTC
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 <dan.carpenter@oracle.com>

Comments

Xinming Hu July 17, 2017, 3:12 a.m. UTC | #1
Hi,

> -----Original Message-----

> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]

> Sent: 2017年7月10日 15:21

> To: Amitkumar Karwar; Xinming Hu

> Cc: Nishant Sarmukadam; Ganapathi Bhat; Kalle Valo;

> linux-wireless@vger.kernel.org; kernel-janitors@vger.kernel.org

> Subject: [EXT] [PATCH] mwifiex: usb: unlock on error in

> mwifiex_usb_tx_aggr_tmo()

> 

> External Email

> 

> ----------------------------------------------------------------------

> 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 <dan.carpenter@oracle.com>

> 

> 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);  }

> 


Change looks fine to me. Thanks.

Regards,
Simon
Kalle Valo July 28, 2017, 2:51 p.m. UTC | #2
Dan Carpenter <dan.carpenter@oracle.com> 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 <dan.carpenter@oracle.com>
> 
> 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()
diff mbox

Patch

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);
 }