summaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2016-10-26 10:53:16 +0200
committerDavid S. Miller <davem@davemloft.net>2016-10-29 20:57:42 +0200
commitb15ca182ed136087f6a2cb9ffe880c923f36a56e (patch)
tree9f5b9829fdeb6491eae3c19d92a1a3a80e19f31d /net/wireless/nl80211.c
parentnet: ip, diag: include net/inet_sock.h (diff)
downloadlinux-b15ca182ed136087f6a2cb9ffe880c923f36a56e.tar.xz
linux-b15ca182ed136087f6a2cb9ffe880c923f36a56e.zip
netlink: Add nla_memdup() to wrap kmemdup() use on nlattr
Wrap several common instances of: kmemdup(nla_data(attr), nla_len(attr), GFP_KERNEL); Signed-off-by: Thomas Graf <tgraf@suug.ch> Acked-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/wireless/nl80211.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 271707dacfea..0d3ab4bfeacf 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10625,8 +10625,7 @@ static int handle_nan_filter(struct nlattr *attr_filter,
i = 0;
nla_for_each_nested(attr, attr_filter, rem) {
- filter[i].filter = kmemdup(nla_data(attr), nla_len(attr),
- GFP_KERNEL);
+ filter[i].filter = nla_memdup(attr, GFP_KERNEL);
filter[i].len = nla_len(attr);
i++;
}