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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Tue, 31 May 2011 12:42:37 +0000 (14:42 +0200)
commit59ee034d0a0cca0947f8ab22f15f9b3a2f139ab8
tree238ed89b301d1c9196d8b94f37f6433cfda07eb6
parent1734dbded65d3af6d4446d9eabc548daa6fce391
can: add missing socket check in can/raw release

BugLink: http://bugs.launchpad.net/bugs/780546
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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/can/raw.c