Skip to content

Commit

Permalink
staging: r8712u: fix potential NULL pointer dereference in r871x_wps_…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent a5e0f69 commit 605fba8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/rtl8712/rtl871x_ioctl_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 605fba8

Please sign in to comment.