aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2013-03-18 03:52:06 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-19 09:44:34 -0400
commitc9bbb75f1dffef0e6ac47abf32cdb668d5e1a867 (patch)
treeaf45c06addaf6b16f748cdcc6b095f52b23cce73 /net
parent1bc277f79260ae6f0888b1234942b6aedfff1289 (diff)
can: dump stack on protocol bugs
The rework of the kernel hlist implementation "hlist: drop the node parameter from iterators" (b67bfe0d42cac56c512dd5da4b1b347a23f4b70a) created some fallout in the form of non matching comments and obsolete code. Additionally to the cleanup this patch adds a WARN() statement to catch the caller of the wrong filter removal request. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/can/af_can.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c
index 8bacf281b3ee..c4e50852c9f4 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -546,16 +546,13 @@ void can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
546 } 546 }
547 547
548 /* 548 /*
549 * Check for bugs in CAN protocol implementations: 549 * Check for bugs in CAN protocol implementations using af_can.c:
550 * If no matching list item was found, the list cursor variable next 550 * 'r' will be NULL if no matching list item was found for removal.
551 * will be NULL, while r will point to the last item of the list.
552 */ 551 */
553 552
554 if (!r) { 553 if (!r) {
555 pr_err("BUG: receive list entry not found for " 554 WARN(1, "BUG: receive list entry not found for dev %s, "
556 "dev %s, id %03X, mask %03X\n", 555 "id %03X, mask %03X\n", DNAME(dev), can_id, mask);
557 DNAME(dev), can_id, mask);
558 r = NULL;
559 goto out; 556 goto out;
560 } 557 }
561 558