mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
can: Add missing socket check in can/bcm release.
commit c6914a6f26 upstream.
We can get here with a NULL socket argument passed from userspace,
so we need to handle it accordingly.
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1c89151b1c
commit
d459e08d10
@@ -1425,9 +1425,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);
|
||||
|
||||
Reference in New Issue
Block a user