]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/rtl8712/rtl871x_ioctl_linux.c
staging: r8712u: fix potential NULL pointer dereference in r871x_wps_start()
[~andy/linux] / drivers / staging / rtl8712 / rtl871x_ioctl_linux.c
index c9a6a7fbb89c53d0946f0b3c1910bd8324955018..3a6479064519aafea0cce74b53e6b156451e7c47 100644 (file)
@@ -2110,10 +2110,10 @@ static int r871x_wps_start(struct net_device *dev,
        struct iw_point *pdata = &wrqu->data;
        u32   u32wps_start = 0;
 
-       if (copy_from_user((void *)&u32wps_start, pdata->pointer, 4))
-               return -EFAULT;
        if ((padapter->bDriverStopped) || (pdata == NULL))
                return -EINVAL;
+       if (copy_from_user((void *)&u32wps_start, pdata->pointer, 4))
+               return -EFAULT;
        if (u32wps_start == 0)
                u32wps_start = *extra;
        if (u32wps_start == 1) /* WPS Start */