can: add missing socket check in can/raw release
authorOliver Hartkopp <socketcan@hartkopp.net>
Wed, 20 Apr 2011 01:57:15 +0000 (01:57 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 May 2011 22:55:42 +0000 (15:55 -0700)
commit5d93d268311c91a6f47f8b1843b60788ba378e4c
tree16b6de2caa47f9bfa1ebe4a426909a50fcf006bc
parentf413fc28a1db54519b75f731a6e57d1ef0269d78
can: add missing socket check in can/raw release

commit 10022a6c66e199d8f61d9044543f38785713cbbd upstream.

v2: added space after 'if' according code style.

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

Thanks to Dave Jones pointing at this issue in net/can/bcm.c

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/can/raw.c