diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-08 08:43:45 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 13:30:01 -0700 |
commit | 605fba82a2d6f8e19b7530805b792487562429a7 (patch) | |
tree | 49796b40bac70ea2e717e63b1ed4037f331d9526 /drivers/staging/rtl8712 | |
parent | a5e0f69c983a142daa95b70f709a3dabf76cb55f (diff) |
staging: r8712u: fix potential NULL pointer dereference in r871x_wps_start()
The dereference should be moved below the NULL test.
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index c9a6a7fbb89c..3a6479064519 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -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 */ |