can: j1939: fix resource leak of skb on error return paths
authorColin Ian King <colin.king@canonical.com>
Wed, 18 Sep 2019 10:11:56 +0000 (11:11 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 4 Nov 2019 20:47:23 +0000 (21:47 +0100)
commitdb1a804cca6fe0cea9dea888d50dda134713c340
treecd71ea3ee0737904a133bf93ad059cf24a5ee767
parentb5018be6d5dd9dd257bf8236298daac8b1262750
can: j1939: fix resource leak of skb on error return paths

Currently the error return paths do not free skb and this results in a
memory leak. Fix this by freeing them before the return.

Addresses-Coverity: ("Resource leak")
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/j1939/socket.c