Skip to content

Commit c9bbb75

Browse files
hartkoppdavem330
authored andcommitted
can: dump stack on protocol bugs
The rework of the kernel hlist implementation "hlist: drop the node parameter from iterators" (b67bfe0) 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>
1 parent 1bc277f commit c9bbb75

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎net/can/af_can.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -546,16 +546,13 @@ void can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
546546
}
547547

548548
/*
549-
* Check for bugs in CAN protocol implementations:
550-
* If no matching list item was found, the list cursor variable next
551-
* will be NULL, while r will point to the last item of the list.
549+
* Check for bugs in CAN protocol implementations using af_can.c:
550+
* 'r' will be NULL if no matching list item was found for removal.
552551
*/
553552

554553
if (!r) {
555-
pr_err("BUG: receive list entry not found for "
556-
"dev %s, id %03X, mask %03X\n",
557-
DNAME(dev), can_id, mask);
558-
r = NULL;
554+
WARN(1, "BUG: receive list entry not found for dev %s, "
555+
"id %03X, mask %03X\n", DNAME(dev), can_id, mask);
559556
goto out;
560557
}
561558

0 commit comments

Comments
 (0)