Commit 605fba82 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a5e0f69c
...@@ -2110,10 +2110,10 @@ static int r871x_wps_start(struct net_device *dev, ...@@ -2110,10 +2110,10 @@ static int r871x_wps_start(struct net_device *dev,
struct iw_point *pdata = &wrqu->data; struct iw_point *pdata = &wrqu->data;
u32 u32wps_start = 0; u32 u32wps_start = 0;
if (copy_from_user((void *)&u32wps_start, pdata->pointer, 4))
return -EFAULT;
if ((padapter->bDriverStopped) || (pdata == NULL)) if ((padapter->bDriverStopped) || (pdata == NULL))
return -EINVAL; return -EINVAL;
if (copy_from_user((void *)&u32wps_start, pdata->pointer, 4))
return -EFAULT;
if (u32wps_start == 0) if (u32wps_start == 0)
u32wps_start = *extra; u32wps_start = *extra;
if (u32wps_start == 1) /* WPS Start */ if (u32wps_start == 1) /* WPS Start */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment