Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] vrf: fix NULL dereference in vrf_finish_output()
@ 2021-08-06 15:04 Dan Carpenter
  2021-08-06 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-08-06 15:04 UTC (permalink / raw)
  To: David Ahern, Vasily Averin
  Cc: David S. Miller, Jakub Kicinski, netdev, kernel-janitors

The "skb" pointer is NULL on this error path so we can't dereference it.
Use "dev" instead.

Fixes: 14ee70ca89e6 ("vrf: use skb_expand_head in vrf_finish_output")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/vrf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 726adf07ef31..662e26117353 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -864,7 +864,7 @@ static int vrf_finish_output(struct net *net, struct sock *sk, struct sk_buff *s
 	if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) {
 		skb = skb_expand_head(skb, hh_len);
 		if (!skb) {
-			skb->dev->stats.tx_errors++;
+			dev->stats.tx_errors++;
 			return -ENOMEM;
 		}
 	}
-- 
2.20.1


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

* Re: [PATCH net-next] vrf: fix NULL dereference in vrf_finish_output()
  2021-08-06 15:04 [PATCH net-next] vrf: fix NULL dereference in vrf_finish_output() Dan Carpenter
@ 2021-08-06 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-06 22:50 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: dsahern, vvs, davem, kuba, netdev, kernel-janitors

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Fri, 6 Aug 2021 18:04:35 +0300 you wrote:
> The "skb" pointer is NULL on this error path so we can't dereference it.
> Use "dev" instead.
> 
> Fixes: 14ee70ca89e6 ("vrf: use skb_expand_head in vrf_finish_output")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/vrf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] vrf: fix NULL dereference in vrf_finish_output()
    https://git.kernel.org/netdev/net-next/c/06669e6880be

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-08-06 22:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 15:04 [PATCH net-next] vrf: fix NULL dereference in vrf_finish_output() Dan Carpenter
2021-08-06 22:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).