]> git.baikalelectronics.ru Git - kernel.git/commit
can: Use WARN_ONCE() instead of BUG_ON() for sanity check in receive path
authorOliver Hartkopp <oliver@hartkopp.net>
Thu, 13 Aug 2009 22:54:25 +0000 (22:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Aug 2009 23:36:57 +0000 (16:36 -0700)
commit83f376b4dc58b70e1a749576c27152ef95a07de3
tree695e60450ec85f7e48b00949c29324c89eca7f20
parentd638d5dbd1607392c5aff8c3a14babe97eab61c8
can: Use WARN_ONCE() instead of BUG_ON() for sanity check in receive path

To ensure a proper handling of CAN frames transported in skbuffs some checks
need to be performed at receive time.

As stated by Michael Olbrich and Luotao Fu BUG_ON() might be to restrictive.
This is right as we can just drop the non conform skbuff and the Kernel can
continue working.

This patch replaces the BUG_ON() with a WARN_ONCE() so that the system remains
healthy but we made the problem visible (once).

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
CC: Michael Olbrich <m.olbrich@pengutronix.de>
CC: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/can/af_can.c