patch-2.4.22 linux-2.4.22/drivers/atm/iphase.c
Next file: linux-2.4.22/drivers/atm/lanai.c
Previous file: linux-2.4.22/drivers/atm/idt77252.c
Back to the patch index
Back to the overall index
- Lines: 49
- Date:
2003-08-25 04:44:41.000000000 -0700
- Orig file:
linux-2.4.21/drivers/atm/iphase.c
- Orig date:
2003-06-13 07:51:32.000000000 -0700
diff -urN linux-2.4.21/drivers/atm/iphase.c linux-2.4.22/drivers/atm/iphase.c
@@ -1186,7 +1186,6 @@
skb_put(skb,len);
// pwang_test
ATM_SKB(skb)->vcc = vcc;
- ATM_SKB(skb)->iovcnt = 0;
ATM_DESC(skb) = desc;
skb_queue_tail(&iadev->rx_dma_q, skb);
@@ -2827,11 +2826,15 @@
break;
case MEMDUMP_FFL:
{
- ia_regs_t regs_local;
- ffredn_t *ffL = ®s_local.ffredn;
- rfredn_t *rfL = ®s_local.rfredn;
+ ia_regs_t *regs_local;
+ ffredn_t *ffL;
+ rfredn_t *rfL;
if (!capable(CAP_NET_ADMIN)) return -EPERM;
+ regs_local = kmalloc(sizeof(*regs_local), GFP_KERNEL);
+ if (!regs_local) return -ENOMEM;
+ ffL = ®s_local->ffredn;
+ rfL = ®s_local->rfredn;
/* Copy real rfred registers into the local copy */
for (i=0; i<(sizeof (rfredn_t))/4; i++)
((u_int *)rfL)[i] = ((u_int *)iadev->reass_reg)[i] & 0xffff;
@@ -2839,8 +2842,11 @@
for (i=0; i<(sizeof (ffredn_t))/4; i++)
((u_int *)ffL)[i] = ((u_int *)iadev->seg_reg)[i] & 0xffff;
- if (copy_to_user(ia_cmds.buf, ®s_local,sizeof(ia_regs_t)))
+ if (copy_to_user(ia_cmds.buf, regs_local,sizeof(ia_regs_t))) {
+ kfree(regs_local);
return -EFAULT;
+ }
+ kfree(regs_local);
printk("Board %d registers dumped\n", board);
ia_cmds.status = 0;
}
@@ -2965,7 +2971,7 @@
dev_kfree_skb_any(skb);
return 0;
}
- kfree(skb);
+ dev_kfree_skb_any(skb);
skb = newskb;
}
/* Get a descriptor number from our free descriptor queue
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)