All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
@ 2020-07-18  5:26 ` Navid Emamdoost
  0 siblings, 0 replies; 11+ messages in thread
From: Navid Emamdoost @ 2020-07-18  5:26 UTC (permalink / raw)
  To: Jakub Kicinski, Kalle Valo, David S. Miller, Matthias Brugger,
	linux-wireless, netdev, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: emamd001, Navid Emamdoost

In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
consumed on all execution paths. Release skb before returning if
test_bit() fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/net/wireless/mediatek/mt7601u/mcu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt7601u/mcu.c b/drivers/net/wireless/mediatek/mt7601u/mcu.c
index af55ed82b96f..1b5cc271a9e1 100644
--- a/drivers/net/wireless/mediatek/mt7601u/mcu.c
+++ b/drivers/net/wireless/mediatek/mt7601u/mcu.c
@@ -116,8 +116,10 @@ mt7601u_mcu_msg_send(struct mt7601u_dev *dev, struct sk_buff *skb,
 	int sent, ret;
 	u8 seq = 0;
 
-	if (test_bit(MT7601U_STATE_REMOVED, &dev->state))
+	if (test_bit(MT7601U_STATE_REMOVED, &dev->state)) {
+		consume_skb(skb);
 		return 0;
+	}
 
 	mutex_lock(&dev->mcu.mutex);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
@ 2020-07-18  5:26 ` Navid Emamdoost
  0 siblings, 0 replies; 11+ messages in thread
From: Navid Emamdoost @ 2020-07-18  5:26 UTC (permalink / raw)
  To: Jakub Kicinski, Kalle Valo, David S. Miller, Matthias Brugger,
	linux-wireless, netdev, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: emamd001, Navid Emamdoost

In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
consumed on all execution paths. Release skb before returning if
test_bit() fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/net/wireless/mediatek/mt7601u/mcu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt7601u/mcu.c b/drivers/net/wireless/mediatek/mt7601u/mcu.c
index af55ed82b96f..1b5cc271a9e1 100644
--- a/drivers/net/wireless/mediatek/mt7601u/mcu.c
+++ b/drivers/net/wireless/mediatek/mt7601u/mcu.c
@@ -116,8 +116,10 @@ mt7601u_mcu_msg_send(struct mt7601u_dev *dev, struct sk_buff *skb,
 	int sent, ret;
 	u8 seq = 0;
 
-	if (test_bit(MT7601U_STATE_REMOVED, &dev->state))
+	if (test_bit(MT7601U_STATE_REMOVED, &dev->state)) {
+		consume_skb(skb);
 		return 0;
+	}
 
 	mutex_lock(&dev->mcu.mutex);
 
-- 
2.17.1


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
@ 2020-07-18  5:26 ` Navid Emamdoost
  0 siblings, 0 replies; 11+ messages in thread
From: Navid Emamdoost @ 2020-07-18  5:26 UTC (permalink / raw)
  To: Jakub Kicinski, Kalle Valo, David S. Miller, Matthias Brugger,
	linux-wireless, netdev, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: emamd001, Navid Emamdoost

In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
consumed on all execution paths. Release skb before returning if
test_bit() fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/net/wireless/mediatek/mt7601u/mcu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt7601u/mcu.c b/drivers/net/wireless/mediatek/mt7601u/mcu.c
index af55ed82b96f..1b5cc271a9e1 100644
--- a/drivers/net/wireless/mediatek/mt7601u/mcu.c
+++ b/drivers/net/wireless/mediatek/mt7601u/mcu.c
@@ -116,8 +116,10 @@ mt7601u_mcu_msg_send(struct mt7601u_dev *dev, struct sk_buff *skb,
 	int sent, ret;
 	u8 seq = 0;
 
-	if (test_bit(MT7601U_STATE_REMOVED, &dev->state))
+	if (test_bit(MT7601U_STATE_REMOVED, &dev->state)) {
+		consume_skb(skb);
 		return 0;
+	}
 
 	mutex_lock(&dev->mcu.mutex);
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
  2020-07-18  5:26 ` Navid Emamdoost
  (?)
@ 2020-07-20 15:54   ` Jakub Kicinski
  -1 siblings, 0 replies; 11+ messages in thread
From: Jakub Kicinski @ 2020-07-20 15:54 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: Kalle Valo, David S. Miller, Matthias Brugger, linux-wireless,
	netdev, linux-arm-kernel, linux-mediatek, linux-kernel

On Sat, 18 Jul 2020 00:26:29 -0500 Navid Emamdoost wrote:
> In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
> consumed on all execution paths. Release skb before returning if
> test_bit() fails.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>

Acked-by: Jakub Kicinski <kubakici@wp.pl>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
@ 2020-07-20 15:54   ` Jakub Kicinski
  0 siblings, 0 replies; 11+ messages in thread
From: Jakub Kicinski @ 2020-07-20 15:54 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: netdev, linux-wireless, linux-kernel, linux-mediatek,
	linux-arm-kernel, Matthias Brugger, David S. Miller, Kalle Valo

On Sat, 18 Jul 2020 00:26:29 -0500 Navid Emamdoost wrote:
> In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
> consumed on all execution paths. Release skb before returning if
> test_bit() fails.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>

Acked-by: Jakub Kicinski <kubakici@wp.pl>

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
@ 2020-07-20 15:54   ` Jakub Kicinski
  0 siblings, 0 replies; 11+ messages in thread
From: Jakub Kicinski @ 2020-07-20 15:54 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: netdev, linux-wireless, linux-kernel, linux-mediatek,
	linux-arm-kernel, Matthias Brugger, David S. Miller, Kalle Valo

On Sat, 18 Jul 2020 00:26:29 -0500 Navid Emamdoost wrote:
> In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
> consumed on all execution paths. Release skb before returning if
> test_bit() fails.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>

Acked-by: Jakub Kicinski <kubakici@wp.pl>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
  2020-07-18  5:26 ` Navid Emamdoost
                   ` (3 preceding siblings ...)
  (?)
@ 2020-08-02 15:11 ` Kalle Valo
  -1 siblings, 0 replies; 11+ messages in thread
From: Kalle Valo @ 2020-08-02 15:11 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: Jakub Kicinski, David S. Miller, Matthias Brugger,
	linux-wireless, netdev, linux-arm-kernel, linux-mediatek,
	linux-kernel, emamd001, Navid Emamdoost

Navid Emamdoost <navid.emamdoost@gmail.com> wrote:

> In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
> consumed on all execution paths. Release skb before returning if
> test_bit() fails.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> Acked-by: Jakub Kicinski <kubakici@wp.pl>

Patch applied to wireless-drivers-next.git, thanks.

880e21490be6 mt7601u: add missing release on skb in mt7601u_mcu_msg_send

-- 
https://patchwork.kernel.org/patch/11671657/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
  2020-07-18  5:26 ` Navid Emamdoost
@ 2020-08-02 15:11   ` Kalle Valo
  -1 siblings, 0 replies; 11+ messages in thread
From: Kalle Valo @ 2020-08-02 15:11 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: Jakub Kicinski, netdev, linux-wireless, linux-kernel, emamd001,
	linux-mediatek, Matthias Brugger, David S. Miller,
	linux-arm-kernel, Navid Emamdoost

Navid Emamdoost <navid.emamdoost@gmail.com> wrote:

> In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
> consumed on all execution paths. Release skb before returning if
> test_bit() fails.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> Acked-by: Jakub Kicinski <kubakici@wp.pl>

Patch applied to wireless-drivers-next.git, thanks.

880e21490be6 mt7601u: add missing release on skb in mt7601u_mcu_msg_send

-- 
https://patchwork.kernel.org/patch/11671657/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
@ 2020-08-02 15:11   ` Kalle Valo
  0 siblings, 0 replies; 11+ messages in thread
From: Kalle Valo @ 2020-08-02 15:11 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: Jakub Kicinski, netdev, linux-wireless, linux-kernel, emamd001,
	linux-mediatek, Matthias Brugger, David S. Miller,
	linux-arm-kernel, Navid Emamdoost

Navid Emamdoost <navid.emamdoost@gmail.com> wrote:

> In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
> consumed on all execution paths. Release skb before returning if
> test_bit() fails.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> Acked-by: Jakub Kicinski <kubakici@wp.pl>

Patch applied to wireless-drivers-next.git, thanks.

880e21490be6 mt7601u: add missing release on skb in mt7601u_mcu_msg_send

-- 
https://patchwork.kernel.org/patch/11671657/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
@ 2020-07-18 14:48 ` Markus Elfring
  0 siblings, 0 replies; 11+ messages in thread
From: Markus Elfring @ 2020-07-18 14:48 UTC (permalink / raw)
  To: Navid Emamdoost, linux-arm-kernel, linux-mediatek,
	linux-wireless, netdev
  Cc: Navid Emamdoost, Matthias Brugger, Jakub Kicinski, Kalle Valo,
	David S. Miller, linux-kernel

…
> +++ b/drivers/net/wireless/mediatek/mt7601u/mcu.c
> @@ -116,8 +116,10 @@ mt7601u_mcu_msg_send(struct mt7601u_dev *dev, struct sk_buff *skb,
>  	int sent, ret;
>  	u8 seq = 0;
>
> -	if (test_bit(MT7601U_STATE_REMOVED, &dev->state))
> +	if (test_bit(MT7601U_STATE_REMOVED, &dev->state)) {
> +		consume_skb(skb);
>  		return 0;
> +	}
…

How do you think about to use the the following statements instead
in the if branch?

		ret = 0;
		goto consume_skb;


Would you like to add the tag “Fixes” to the commit message?

Regards,
Markus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send
@ 2020-07-18 14:48 ` Markus Elfring
  0 siblings, 0 replies; 11+ messages in thread
From: Markus Elfring @ 2020-07-18 14:48 UTC (permalink / raw)
  To: Navid Emamdoost, linux-arm-kernel, linux-mediatek,
	linux-wireless, netdev
  Cc: Jakub Kicinski, linux-kernel, Navid Emamdoost, Matthias Brugger,
	David S. Miller, Kalle Valo

…
> +++ b/drivers/net/wireless/mediatek/mt7601u/mcu.c
> @@ -116,8 +116,10 @@ mt7601u_mcu_msg_send(struct mt7601u_dev *dev, struct sk_buff *skb,
>  	int sent, ret;
>  	u8 seq = 0;
>
> -	if (test_bit(MT7601U_STATE_REMOVED, &dev->state))
> +	if (test_bit(MT7601U_STATE_REMOVED, &dev->state)) {
> +		consume_skb(skb);
>  		return 0;
> +	}
…

How do you think about to use the the following statements instead
in the if branch?

		ret = 0;
		goto consume_skb;


Would you like to add the tag “Fixes” to the commit message?

Regards,
Markus

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-08-02 15:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-18  5:26 [PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send Navid Emamdoost
2020-07-18  5:26 ` Navid Emamdoost
2020-07-18  5:26 ` Navid Emamdoost
2020-07-20 15:54 ` Jakub Kicinski
2020-07-20 15:54   ` Jakub Kicinski
2020-07-20 15:54   ` Jakub Kicinski
2020-08-02 15:11 ` Kalle Valo
2020-08-02 15:11   ` Kalle Valo
2020-08-02 15:11 ` Kalle Valo
2020-07-18 14:48 Markus Elfring
2020-07-18 14:48 ` Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.