From 6429852aefdaf7ff6971e3fdc1069684a6461c82 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 20 Dec 2022 12:54:14 +0000 Subject: [PATCH] Revert "can: af_can: fix NULL pointer dereference in can_rcv_filter" This reverts commit 3982652957e8d79ac32efcb725450580650a8644 which is commit 0acc442309a0a1b01bcdaa135e56e6398a49439c upstream. It is fixing a commit that was reverted from the Android tree due to it breaking the ABI, so it is not needed here at all. Revert it now as it breaks the build. Fixes: 3982652957e8 ("can: af_can: fix NULL pointer dereference in can_rcv_filter") Change-Id: I049aff8719673d31da9429579162d0aa1025834e Signed-off-by: Greg Kroah-Hartman --- net/can/af_can.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/can/af_can.c b/net/can/af_can.c index ac61b8f14477..306d3584a441 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c @@ -678,7 +678,7 @@ static int can_rcv(struct sk_buff *skb, struct net_device *dev, { struct canfd_frame *cfd = (struct canfd_frame *)skb->data; - if (unlikely(dev->type != ARPHRD_CAN || !can_get_ml_priv(dev) || skb->len != CAN_MTU)) { + if (unlikely(dev->type != ARPHRD_CAN || skb->len != CAN_MTU)) { pr_warn_once("PF_CAN: dropped non conform CAN skbuff: dev type %d, len %d\n", dev->type, skb->len); goto free_skb; @@ -704,7 +704,7 @@ static int canfd_rcv(struct sk_buff *skb, struct net_device *dev, { struct canfd_frame *cfd = (struct canfd_frame *)skb->data; - if (unlikely(dev->type != ARPHRD_CAN || !can_get_ml_priv(dev) || skb->len != CANFD_MTU)) { + if (unlikely(dev->type != ARPHRD_CAN || skb->len != CANFD_MTU)) { pr_warn_once("PF_CAN: dropped non conform CAN FD skbuff: dev type %d, len %d\n", dev->type, skb->len); goto free_skb;