提交 c6914a6f 编写于 作者: D Dave Jones 提交者: David S. Miller

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: NDave Jones <davej@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0b0dc0f1
...@@ -1427,9 +1427,14 @@ static int bcm_init(struct sock *sk) ...@@ -1427,9 +1427,14 @@ static int bcm_init(struct sock *sk)
static int bcm_release(struct socket *sock) static int bcm_release(struct socket *sock)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct bcm_sock *bo = bcm_sk(sk); struct bcm_sock *bo;
struct bcm_op *op, *next; struct bcm_op *op, *next;
if (sk == NULL)
return 0;
bo = bcm_sk(sk);
/* remove bcm_ops, timer, rx_unregister(), etc. */ /* remove bcm_ops, timer, rx_unregister(), etc. */
unregister_netdevice_notifier(&bo->notifier); unregister_netdevice_notifier(&bo->notifier);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册