Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> --- net/can/j1939/socket.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c index 89174b517b28..12db6a32efee 100644 --- a/net/can/j1939/socket.c +++ b/net/can/j1939/socket.c @@ -416,7 +416,7 @@ static int j1939_sk_bind(struct socket *sock, struct sockaddr *uaddr, int len) ret = j1939_local_ecu_get(priv, jsk->addr.src_name, jsk->addr.sa); if (ret) { j1939_netdev_stop(ndev); - goto out_dev_put; + goto out_priv_put; } if (!(jsk->state & J1939_SOCK_BOUND)) { @@ -426,9 +426,10 @@ static int j1939_sk_bind(struct socket *sock, struct sockaddr *uaddr, int len) jsk->state |= J1939_SOCK_BOUND; } - j1939_priv_put(priv); - out_dev_put: /* fallthrough */ + out_priv_put: /* fallthrough */ + j1939_priv_put(priv); + out_dev_put: dev_put(ndev); out_release_sock: release_sock(sock->sk); -- 2.20.1