Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6914a6f authored by Dave Jones's avatar Dave Jones Committed by David S. Miller
Browse files

can: Add missing socket check in can/bcm release.



We can get here with a NULL socket argument passed from userspace,
so we need to handle it accordingly.

Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0b0dc0f1
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1427,9 +1427,14 @@ static int bcm_init(struct sock *sk)
static int bcm_release(struct socket *sock)
{
	struct sock *sk = sock->sk;
	struct bcm_sock *bo = bcm_sk(sk);
	struct bcm_sock *bo;
	struct bcm_op *op, *next;

	if (sk == NULL)
		return 0;

	bo = bcm_sk(sk);

	/* remove bcm_ops, timer, rx_unregister(), etc. */

	unregister_netdevice_notifier(&bo->notifier);