Skip to content
Commit ca4c6ebe authored by Qinglang Miao's avatar Qinglang Miao Committed by Marc Kleine-Budde
Browse files

can: mcp251xfd: mcp251xfd_handle_rxif_one(): fix wrong NULL pointer check

If alloc_canfd_skb() returns NULL, 'cfg' is an uninitialized variable, so we
should check 'skb' rather than 'cfd' after calling alloc_canfd_skb(priv->ndev,
&cfd).

Fixes: 55e5b97f

 ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN")
Signed-off-by: default avatarQinglang Miao <miaoqinglang@huawei.com>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20210113073100.79552-1-miaoqinglang@huawei.com
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent b42b3a27
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment