Message ID | 20210119020221.3713-1-angkery@163.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | can: mcp251xfd: mcp251xfd_handle_ivmif(): fix wrong NULL pointer check | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Series ignored based on subject |
On 1/19/21 3:02 AM, angkery wrote: > From: Junlin Yang <yangjunlin@yulong.com> > > if alloc_can_err_skb() returns NULL, we should check skb instead of cf. Have a look at the function, there is a check for cf several times before this. But as cf is initialized as NULL this is should be no problem. While in: | ca4c6ebeeb50 can: mcp251xfd: mcp251xfd_handle_rxif_one(): | fix wrong NULL pointer check a real problem has been fixed. Marc
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);