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)
commitd763ab3044f0bf50bd0e6179f6b2cf1c125d1d94
tree2f83dd7a667f2267fa05baa69b3d5ffc928a85e4
parent4e9016bee3bf0c24963097edace034ff205b565c
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