]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] depca fix from maintainer
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Mon, 28 Oct 2002 06:45:53 +0000 (22:45 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 28 Oct 2002 06:45:53 +0000 (22:45 -0800)
drivers/net/depca.c

index 7fd5588ebb3b4db0bcbd8c01ae0ca85bcb20e741..f9e8f29c0b22e033f558a792c61f2b5611d76d8c 100644 (file)
@@ -938,7 +938,7 @@ static void depca_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        spin_unlock(&lp->lock);
 }
 
-
+/* Called with lp->lock held */
 static int depca_rx(struct net_device *dev)
 {
        struct depca_private *lp = (struct depca_private *) dev->priv;
@@ -1036,6 +1036,7 @@ static int depca_rx(struct net_device *dev)
 
 /*
 ** Buffer sent - check for buffer errors.
+** Called with lp->lock held
 */
 static int depca_tx(struct net_device *dev)
 {
@@ -2003,7 +2004,7 @@ static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
                spin_lock_irqsave(&lp->lock, flags);
                memcpy(buf, &lp->pktStats, ioc->len);
                spin_unlock_irqrestore(&lp->lock, flags);
-               if (copy_to_user(ioc->data, &lp->pktStats, ioc->len))
+               if (copy_to_user(ioc->data, buf, ioc->len))
                        status = -EFAULT;
                kfree(buf);
                break;