summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChuck Short <zulcss@gmail.com>2006-09-25 22:31:03 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 17:53:55 -0700
commit83e331e2a492a134e491bcf50c984fd50c7fae03 (patch)
tree47ebe92b328ba1456e9437d09c7da3d1fc233b96 /drivers
parent293b9c42511d800b5f7bb2acba50f3e584b8c410 (diff)
[IRDA] via-ircc: fix memory leak
Fix memory leak. Coverity id# 653 patch location: http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=a1f34cb68b16807ed9d5ebb0f6a6ec5ff8a5fc78 Signed-off-by: Chuck Short <zulcss@gmail.com> Signed-off-by: Ben Collins <bcollins@ubuntu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/irda/via-ircc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 79b85f327500..d916e1257c47 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -1223,8 +1223,13 @@ static int upload_rxdata(struct via_ircc_cb *self, int iobase)
IRDA_DEBUG(2, "%s(): len=%x\n", __FUNCTION__, len);
+ if ((len - 4) < 2) {
+ self->stats.rx_dropped++;
+ return FALSE;
+ }
+
skb = dev_alloc_skb(len + 1);
- if ((skb == NULL) || ((len - 4) < 2)) {
+ if (skb == NULL) {
self->stats.rx_dropped++;
return FALSE;
}