diff mbox series

net: dsa: sja1105: Fix missing unlock on error in sk_buff()

Message ID 20190717062956.127446-1-weiyongjun1@huawei.com
State Accepted
Delegated to: David Miller
Headers show
Series net: dsa: sja1105: Fix missing unlock on error in sk_buff() | expand

Commit Message

Wei Yongjun July 17, 2019, 6:29 a.m. UTC
Add the missing unlock before return from function sk_buff()
in the error handling case.

Fixes: f3097be21bf1 ("net: dsa: sja1105: Add a state machine for RX timestamping")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 net/dsa/tag_sja1105.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Vladimir Oltean July 17, 2019, 5:58 p.m. UTC | #1
On Wed, 17 Jul 2019 at 09:24, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> Add the missing unlock before return from function sk_buff()
> in the error handling case.
>
> Fixes: f3097be21bf1 ("net: dsa: sja1105: Add a state machine for RX timestamping")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

>  net/dsa/tag_sja1105.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c
> index 1d96c9d4a8e9..26363d72d25b 100644
> --- a/net/dsa/tag_sja1105.c
> +++ b/net/dsa/tag_sja1105.c
> @@ -216,6 +216,7 @@ static struct sk_buff
>                 if (!skb) {
>                         dev_err_ratelimited(dp->ds->dev,
>                                             "Failed to copy stampable skb\n");
> +                       spin_unlock(&sp->data->meta_lock);
>                         return NULL;
>                 }
>                 sja1105_transfer_meta(skb, meta);
>
>
>
Vivien Didelot July 18, 2019, 4:42 p.m. UTC | #2
On Wed, 17 Jul 2019 06:29:56 +0000, Wei Yongjun <weiyongjun1@huawei.com> wrote:
> Add the missing unlock before return from function sk_buff()
> in the error handling case.
> 
> Fixes: f3097be21bf1 ("net: dsa: sja1105: Add a state machine for RX timestamping")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
Florian Fainelli July 18, 2019, 5:24 p.m. UTC | #3
On 7/16/19 11:29 PM, Wei Yongjun wrote:
> Add the missing unlock before return from function sk_buff()
> in the error handling case.
> 
> Fixes: f3097be21bf1 ("net: dsa: sja1105: Add a state machine for RX timestamping")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
David Miller July 18, 2019, 11:33 p.m. UTC | #4
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Wed, 17 Jul 2019 06:29:56 +0000

> Add the missing unlock before return from function sk_buff()
> in the error handling case.
> 
> Fixes: f3097be21bf1 ("net: dsa: sja1105: Add a state machine for RX timestamping")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.
diff mbox series

Patch

diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c
index 1d96c9d4a8e9..26363d72d25b 100644
--- a/net/dsa/tag_sja1105.c
+++ b/net/dsa/tag_sja1105.c
@@ -216,6 +216,7 @@  static struct sk_buff
 		if (!skb) {
 			dev_err_ratelimited(dp->ds->dev,
 					    "Failed to copy stampable skb\n");
+			spin_unlock(&sp->data->meta_lock);
 			return NULL;
 		}
 		sja1105_transfer_meta(skb, meta);