can: bcm: fix warning in bcm_connect/proc_register
authorOliver Hartkopp <socketcan@hartkopp.net>
Mon, 24 Oct 2016 19:11:26 +0000 (21:11 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 31 Oct 2016 19:48:19 +0000 (20:48 +0100)
commitdeb507f91f1adbf64317ad24ac46c56eeccfb754
treeb8fb378600f3f87550ba29171f0993a1f10fe7b4
parent460d2830b00db407be2b72ed792eb3596f245192
can: bcm: fix warning in bcm_connect/proc_register

Andrey Konovalov reported an issue with proc_register in bcm.c.
As suggested by Cong Wang this patch adds a lock_sock() protection and
a check for unsuccessful proc_create_data() in bcm_connect().

Reference: http://marc.info/?l=linux-netdev&m=147732648731237

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Suggested-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/bcm.c