From: Junlin Yang <yangjunlin@xxxxxxxxxx> if alloc_can_err_skb() returns NULL, we should check skb instead of cf. Signed-off-by: Junlin Yang <yangjunlin@xxxxxxxxxx> --- 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