]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:23 +0000 (14:21 -0300)
commiteee6bab58ebb2deddf853c22c1d46c66d8c8ebe5
tree0be9ed452f764b7bcae5cc59ad81363df0c65296
parent6d38749b592873a50c6a062055aa38ba46a75a43
can: rx-offload: can_rx_offload_offload_one(): use ERR_PTR() to propagate error value in case of errors

BugLink: https://bugs.launchpad.net/bugs/1855787
[ Upstream commit d763ab3044f0bf50bd0e6179f6b2cf1c125d1d94 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/can/rx-offload.c