summaryrefslogtreecommitdiff
path: root/drivers/net/irda/irda-usb.c
diff options
context:
space:
mode:
authorEugene Teo <eugene.teo@eugeneteo.net>2006-03-15 14:57:19 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 14:50:03 -0800
commitda81817fbd744ce70983f1d3c61841265003c7f4 (patch)
tree6df199268afd7293c86bc06699db11644b5bddfd /drivers/net/irda/irda-usb.c
parent09abfa8048de8e68eaa09eb07ac18f2d549dfe58 (diff)
[PATCH] USB: Fix irda-usb use after use
Don't read from free'd memory after calling netif_rx(). docopy is used as a boolean (0 and 1) so unsigned int is sufficient. Coverity bug #928 Signed-off-by: Eugene Teo <eugene.teo@eugeneteo.net> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/irda/irda-usb.c')
-rw-r--r--drivers/net/irda/irda-usb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 8936058a3cce..6e2ec56cde0b 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -740,7 +740,7 @@ static void irda_usb_receive(struct urb *urb, struct pt_regs *regs)
struct sk_buff *newskb;
struct sk_buff *dataskb;
struct urb *next_urb;
- int docopy;
+ unsigned int len, docopy;
IRDA_DEBUG(2, "%s(), len=%d\n", __FUNCTION__, urb->actual_length);
@@ -851,10 +851,11 @@ static void irda_usb_receive(struct urb *urb, struct pt_regs *regs)
dataskb->dev = self->netdev;
dataskb->mac.raw = dataskb->data;
dataskb->protocol = htons(ETH_P_IRDA);
+ len = dataskb->len;
netif_rx(dataskb);
/* Keep stats up to date */
- self->stats.rx_bytes += dataskb->len;
+ self->stats.rx_bytes += len;
self->stats.rx_packets++;
self->netdev->last_rx = jiffies;