Patchwork can: sja1000: fix bug using library functions for skb allocation

login
register
mail settings
Submitter Wolfgang Grandegger
Date Oct. 26, 2009, 3:46 p.m.
Message ID <4AE5C444.9030804@grandegger.com>
Download mbox | patch
Permalink /patch/36926/
State Accepted
Delegated to: David Miller
Headers show

Comments

Wolfgang Grandegger - Oct. 26, 2009, 3:46 p.m.
Commit 7b6856a0 "can: provide library functions for skb allocation"
did not properly remove two lines of the SJA1000 driver resulting in
a 'skb_over_panic' when calling skb_put, as reported by Kurt.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 drivers/net/can/sja1000/sja1000.c |    2 --
 1 file changed, 2 deletions(-)

--
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
David Miller - Oct. 27, 2009, 12:34 a.m.
From: Wolfgang Grandegger <wg@grandegger.com>
Date: Mon, 26 Oct 2009 16:46:12 +0100

> Commit 7b6856a0 "can: provide library functions for skb allocation"
> did not properly remove two lines of the SJA1000 driver resulting in
> a 'skb_over_panic' when calling skb_put, as reported by Kurt.
> 
> Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>

Applied, thanks.
--
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

Patch

Index: net-next-2.6/drivers/net/can/sja1000/sja1000.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/sja1000/sja1000.c
+++ net-next-2.6/drivers/net/can/sja1000/sja1000.c
@@ -321,8 +321,6 @@  static void sja1000_rx(struct net_device
 	if (fi & FI_RTR)
 		id |= CAN_RTR_FLAG;

-	cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
-	memset(cf, 0, sizeof(struct can_frame));
 	cf->can_id = id;
 	cf->can_dlc = dlc;
 	for (i = 0; i < dlc; i++)