]> git.hungrycats.org Git - linux/commitdiff
[janitor] update the ray_cs.c PCMCIA client driver for the Raylink wireless LAN card
authorWilliam Stinson <wstinson@infonie.fr>
Fri, 14 Jun 2002 15:01:26 +0000 (11:01 -0400)
committerJeff Garzik <jgarzik@mandrakesoft.com>
Fri, 14 Jun 2002 15:01:26 +0000 (11:01 -0400)
1) checks the result of copy_to_user and
2) returns -EFAULT in case not all data was copied.

I don't have this hardware so compilation checked only.

drivers/net/pcmcia/ray_cs.c

index 4c09a53dfc46b51ae59252e5e68b229ddbe7bca7..e2108b310de3a7814304a1730a674238c0a81a5f 100644 (file)
@@ -1316,9 +1316,12 @@ static int ray_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                    err = -E2BIG;
                    break;
                }
-               copy_from_user(card_essid,
-                              wrq->u.data.pointer,
-                              wrq->u.data.length);
+               if (copy_from_user(card_essid,
+                                  wrq->u.data.pointer,
+                                  wrq->u.data.length)) {
+                       err = -EFAULT;
+                       break;
+               }
                card_essid[IW_ESSID_MAX_SIZE] = '\0';
 
                /* Set the ESSID in the card */