diff options
author | Thomas Graf <tgraf@suug.ch> | 2016-10-26 11:53:16 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-29 21:57:42 +0300 |
commit | b15ca182ed136087f6a2cb9ffe880c923f36a56e (patch) | |
tree | 9f5b9829fdeb6491eae3c19d92a1a3a80e19f31d /net/sched/act_bpf.c | |
parent | f8da977989c5d5d2f38e025d4ac1e18243723dbb (diff) | |
download | linux-b15ca182ed136087f6a2cb9ffe880c923f36a56e.tar.xz |
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 'net/sched/act_bpf.c')
-rw-r--r-- | net/sched/act_bpf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index 1d3960033f61..9ff06cfbcdec 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c @@ -226,9 +226,7 @@ static int tcf_bpf_init_from_efd(struct nlattr **tb, struct tcf_bpf_cfg *cfg) return PTR_ERR(fp); if (tb[TCA_ACT_BPF_NAME]) { - name = kmemdup(nla_data(tb[TCA_ACT_BPF_NAME]), - nla_len(tb[TCA_ACT_BPF_NAME]), - GFP_KERNEL); + name = nla_memdup(tb[TCA_ACT_BPF_NAME], GFP_KERNEL); if (!name) { bpf_prog_put(fp); return -ENOMEM; |