All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH can-next] can: dump stack on protocol bugs
@ 2013-03-18 17:52 Oliver Hartkopp
  2013-03-19 13:55 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Hartkopp @ 2013-03-18 17:52 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: Linux Netdev List

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>

---

diff --git a/net/can/af_can.c b/net/can/af_can.c
index 8bacf28..c4e5085 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,
 	}
 
 	/*
-	 * Check for bugs in CAN protocol implementations:
-	 * If no matching list item was found, the list cursor variable next
-	 * will be NULL, while r will point to the last item of the list.
+	 * Check for bugs in CAN protocol implementations using af_can.c:
+	 * 'r' will be NULL if no matching list item was found for removal.
 	 */
 
 	if (!r) {
-		pr_err("BUG: receive list entry not found for "
-		       "dev %s, id %03X, mask %03X\n",
-		       DNAME(dev), can_id, mask);
-		r = NULL;
+		WARN(1, "BUG: receive list entry not found for dev %s, "
+		     "id %03X, mask %03X\n", DNAME(dev), can_id, mask);
 		goto out;
 	}
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH can-next] can: dump stack on protocol bugs
  2013-03-18 17:52 [PATCH can-next] can: dump stack on protocol bugs Oliver Hartkopp
@ 2013-03-19 13:55 ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-03-19 13:55 UTC (permalink / raw)
  To: socketcan; +Cc: mkl, netdev

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: Mon, 18 Mar 2013 18:52:06 +0100

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH can-next] can: dump stack on protocol bugs
@ 2013-03-18 18:22 Oliver Hartkopp
  0 siblings, 0 replies; 3+ messages in thread
From: Oliver Hartkopp @ 2013-03-18 18:22 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can

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>

---

diff --git a/net/can/af_can.c b/net/can/af_can.c
index 8bacf28..c4e5085 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,
 	}
  	/*
-	 * Check for bugs in CAN protocol implementations:
-	 * If no matching list item was found, the list cursor variable next
-	 * will be NULL, while r will point to the last item of the list.
+	 * Check for bugs in CAN protocol implementations using af_can.c:
+	 * 'r' will be NULL if no matching list item was found for removal.
 	 */
  	if (!r) {
-		pr_err("BUG: receive list entry not found for "
-		       "dev %s, id %03X, mask %03X\n",
-		       DNAME(dev), can_id, mask);
-		r = NULL;
+		WARN(1, "BUG: receive list entry not found for dev %s, "
+		     "id %03X, mask %03X\n", DNAME(dev), can_id, mask);
 		goto out;
 	}


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-19 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-18 17:52 [PATCH can-next] can: dump stack on protocol bugs Oliver Hartkopp
2013-03-19 13:55 ` David Miller
2013-03-18 18:22 Oliver Hartkopp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.