提交 e9aeabae 编写于 作者: J Johannes Berg 提交者: John W. Linville

mac80211: validate SIOCSIWPOWER arguments better

Don't accept any arguments we don't handle, and return error codes
instead of using an uninitialised stack value.
Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
Reviewed-by: NKalle Valo <kalle.valo@nokia.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 4797938c
......@@ -853,9 +853,12 @@ static int ieee80211_ioctl_siwpower(struct net_device *dev,
ps = true;
break;
default: /* Otherwise we ignore */
break;
return -EINVAL;
}
if (wrq->flags & ~(IW_POWER_MODE | IW_POWER_TIMEOUT))
return -EINVAL;
if (wrq->flags & IW_POWER_TIMEOUT)
timeout = wrq->value / 1000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册