rt2500usb: disallow to set WEP key with non zero index
[platform/kernel/linux-rpi.git] / drivers / net / wireless / orinoco / wext.c
index 5775124..cf7be1e 100644 (file)
@@ -128,7 +128,7 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
        } else {
                struct {
                        __le16 qual, signal, noise, unused;
-               } __attribute__ ((packed)) cq;
+               } __packed cq;
 
                err = HERMES_READ_RECORD(hw, USER_BAP,
                                         HERMES_RID_COMMSQUALITY, &cq);
@@ -993,11 +993,9 @@ static int orinoco_ioctl_set_genie(struct net_device *dev,
                return -EINVAL;
 
        if (wrqu->data.length) {
-               buf = kmalloc(wrqu->data.length, GFP_KERNEL);
+               buf = kmemdup(extra, wrqu->data.length, GFP_KERNEL);
                if (buf == NULL)
                        return -ENOMEM;
-
-               memcpy(buf, extra, wrqu->data.length);
        } else
                buf = NULL;