* [PATCH 1/7] drivers/isdn/mISDN/stack.c: remove invalid reference to list iterator variable
[not found] <1341747464-1772-1-git-send-email-Julia.Lawall@lip6.fr>
@ 2012-07-08 11:37 ` Julia Lawall
2012-07-09 22:24 ` David Miller
2012-07-08 11:37 ` [PATCH 2/7] net/rxrpc/ar-peer.c: " Julia Lawall
2012-07-08 11:37 ` [PATCH 6/7] drivers/net/ethernet/broadcom/cnic.c: " Julia Lawall
2 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2012-07-08 11:37 UTC (permalink / raw)
To: Karsten Keil; +Cc: kernel-janitors, netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
If list_for_each_entry, etc complete a traversal of the list, the iterator
variable ends up pointing to an address at an offset from the list head,
and not a meaningful structure. Thus this value should not be used after
the end of the iterator. The dereferences are just deleted from the
debugging statement.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/isdn/mISDN/stack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c
index 1a0ae44..5f21f62 100644
--- a/drivers/isdn/mISDN/stack.c
+++ b/drivers/isdn/mISDN/stack.c
@@ -135,8 +135,8 @@ send_layer2(struct mISDNstack *st, struct sk_buff *skb)
skb = NULL;
else if (*debug & DEBUG_SEND_ERR)
printk(KERN_DEBUG
- "%s ch%d mgr prim(%x) addr(%x) err %d\n",
- __func__, ch->nr, hh->prim, ch->addr, ret);
+ "%s mgr prim(%x) err %d\n",
+ __func__, hh->prim, ret);
}
out:
mutex_unlock(&st->lmutex);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/7] net/rxrpc/ar-peer.c: remove invalid reference to list iterator variable
[not found] <1341747464-1772-1-git-send-email-Julia.Lawall@lip6.fr>
2012-07-08 11:37 ` [PATCH 1/7] drivers/isdn/mISDN/stack.c: remove invalid reference to list iterator variable Julia Lawall
@ 2012-07-08 11:37 ` Julia Lawall
2012-07-09 22:24 ` David Miller
2012-07-08 11:37 ` [PATCH 6/7] drivers/net/ethernet/broadcom/cnic.c: " Julia Lawall
2 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2012-07-08 11:37 UTC (permalink / raw)
To: David S. Miller; +Cc: kernel-janitors, netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
If list_for_each_entry, etc complete a traversal of the list, the iterator
variable ends up pointing to an address at an offset from the list head,
and not a meaningful structure. Thus this value should not be used after
the end of the iterator. This seems to be a copy-paste bug from a previous
debugging message, and so the meaningless value is just deleted.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
net/rxrpc/ar-peer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c
index 2754f09..bebaa43 100644
--- a/net/rxrpc/ar-peer.c
+++ b/net/rxrpc/ar-peer.c
@@ -229,7 +229,7 @@ found_UDP_peer:
return peer;
new_UDP_peer:
- _net("Rx UDP DGRAM from NEW peer %d", peer->debug_id);
+ _net("Rx UDP DGRAM from NEW peer");
read_unlock_bh(&rxrpc_peer_lock);
_leave(" = -EBUSY [new]");
return ERR_PTR(-EBUSY);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/7] net/rxrpc/ar-peer.c: remove invalid reference to list iterator variable
2012-07-08 11:37 ` [PATCH 2/7] net/rxrpc/ar-peer.c: " Julia Lawall
@ 2012-07-09 22:24 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-07-09 22:24 UTC (permalink / raw)
To: Julia.Lawall; +Cc: kernel-janitors, netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 8 Jul 2012 13:37:39 +0200
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> If list_for_each_entry, etc complete a traversal of the list, the iterator
> variable ends up pointing to an address at an offset from the list head,
> and not a meaningful structure. Thus this value should not be used after
> the end of the iterator. This seems to be a copy-paste bug from a previous
> debugging message, and so the meaningless value is just deleted.
>
> This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 6/7] drivers/net/ethernet/broadcom/cnic.c: remove invalid reference to list iterator variable
[not found] <1341747464-1772-1-git-send-email-Julia.Lawall@lip6.fr>
2012-07-08 11:37 ` [PATCH 1/7] drivers/isdn/mISDN/stack.c: remove invalid reference to list iterator variable Julia Lawall
2012-07-08 11:37 ` [PATCH 2/7] net/rxrpc/ar-peer.c: " Julia Lawall
@ 2012-07-08 11:37 ` Julia Lawall
2012-07-09 22:25 ` David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2012-07-08 11:37 UTC (permalink / raw)
To: netdev; +Cc: kernel-janitors, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
If list_for_each_entry, etc complete a traversal of the list, the iterator
variable ends up pointing to an address at an offset from the list head,
and not a meaningful structure. Thus this value should not be used after
the end of the iterator. There does not seem to be a meaningful value to
provide to netdev_warn. Replace with pr_warn, since pr_err is used
elsewhere.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/ethernet/broadcom/cnic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 22ad7b6..6eaca60 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -542,7 +542,8 @@ int cnic_unregister_driver(int ulp_type)
}
if (atomic_read(&ulp_ops->ref_count) != 0)
- netdev_warn(dev->netdev, "Failed waiting for ref count to go to zero\n");
+ pr_warn("%s: Failed waiting for ref count to go to zero\n",
+ __func__);
return 0;
out_unlock:
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 6/7] drivers/net/ethernet/broadcom/cnic.c: remove invalid reference to list iterator variable
2012-07-08 11:37 ` [PATCH 6/7] drivers/net/ethernet/broadcom/cnic.c: " Julia Lawall
@ 2012-07-09 22:25 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-07-09 22:25 UTC (permalink / raw)
To: Julia.Lawall; +Cc: netdev, kernel-janitors, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 8 Jul 2012 13:37:43 +0200
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> If list_for_each_entry, etc complete a traversal of the list, the iterator
> variable ends up pointing to an address at an offset from the list head,
> and not a meaningful structure. Thus this value should not be used after
> the end of the iterator. There does not seem to be a meaningful value to
> provide to netdev_warn. Replace with pr_warn, since pr_err is used
> elsewhere.
>
> This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread