lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210119020221.3713-1-angkery@163.com>
Date:   Tue, 19 Jan 2021 10:02:21 +0800
From:   angkery <angkery@....com>
To:     mkl@...gutronix.de, manivannan.sadhasivam@...aro.org,
        thomas.kopp@...rochip.com, wg@...ndegger.com, davem@...emloft.net,
        kuba@...nel.org
Cc:     linux-can@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Junlin Yang <yangjunlin@...ong.com>
Subject: [PATCH] can: mcp251xfd: mcp251xfd_handle_ivmif(): fix wrong NULL pointer check

From: Junlin Yang <yangjunlin@...ong.com>

if alloc_can_err_skb() returns NULL, we should check skb instead of cf.

Signed-off-by: Junlin Yang <yangjunlin@...ong.com>
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index f07e8b7..0af131c 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -1755,7 +1755,7 @@ static int mcp251xfd_handle_ivmif(struct mcp251xfd_priv *priv)
 			cf->data[2] |= CAN_ERR_PROT_TX | CAN_ERR_PROT_BIT0;
 	}
 
-	if (!cf)
+	if (!skb)
 		return 0;
 
 	err = can_rx_offload_queue_sorted(&priv->offload, skb, timestamp);
-- 
1.9.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ