summaryrefslogtreecommitdiff
path: root/lib/nlattr.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-04-09 07:48:27 +1000
committerDave Airlie <airlied@redhat.com>2015-04-09 07:48:27 +1000
commit1d8ac08d498d579aae36221a80b4b724b2f52f39 (patch)
tree3177ed7b82edbb34055da95c50b418db5cd4ba60 /lib/nlattr.c
parent5c7f0c27956a9884e29dbe5f83e56609fa00290f (diff)
parentf22e6e847115abc3a0e2ad7bb18d243d42275af1 (diff)
Merge tag 'v4.0-rc7' into drm-next
Linux 4.0-rc7 Requested by Alex for fixes -next needs. Conflicts: drivers/gpu/drm/i915/intel_sprite.c
Diffstat (limited to 'lib/nlattr.c')
-rw-r--r--lib/nlattr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/nlattr.c b/lib/nlattr.c
index 76a1b59523ab..f5907d23272d 100644
--- a/lib/nlattr.c
+++ b/lib/nlattr.c
@@ -279,6 +279,8 @@ int nla_memcpy(void *dest, const struct nlattr *src, int count)
int minlen = min_t(int, count, nla_len(src));
memcpy(dest, nla_data(src), minlen);
+ if (count > minlen)
+ memset(dest + minlen, 0, count - minlen);
return minlen;
}