Commit 91859c08 authored by Chas Williams's avatar Chas Williams Committed by David S. Miller

[ATM]: Fix excessive stack usage in iphase driver.

parent 47507516
......@@ -2792,11 +2792,15 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
break;
case MEMDUMP_FFL:
{
ia_regs_t regs_local;
ffredn_t *ffL = &regs_local.ffredn;
rfredn_t *rfL = &regs_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 = &regs_local->ffredn;
rfL = &regs_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;
......@@ -2804,8 +2808,11 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
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, &regs_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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment