]> git.baikalelectronics.ru Git - kernel.git/commit
can: rx-offload: can_rx_offload_offload_one(): use ERR_PTR() to propagate error value...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 9 Oct 2019 19:00:32 +0000 (21:00 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 4 Nov 2019 20:47:22 +0000 (21:47 +0100)
commit7a9cbbfc483f412147c952418e4fb63518c12c3b
tree2f83dd7a667f2267fa05baa69b3d5ffc928a85e4
parent13b9e7abb17c7ac3d1538af3360c2376bea767c6
can: rx-offload: can_rx_offload_offload_one(): use ERR_PTR() to propagate error value in case of errors

Before this patch can_rx_offload_offload_one() returns a pointer to a
skb containing the read CAN frame or a NULL pointer.

However the meaning of the NULL pointer is ambiguous, it can either mean
the requested mailbox is empty or there was an error.

This patch fixes this situation by returning:
- pointer to skb on success
- NULL pointer if mailbox is empty
- ERR_PTR() in case of an error

All users of can_rx_offload_offload_one() have been adopted, no
functional change intended.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/rx-offload.c