projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[SOCK][NETNS]: Add a struct net argument to sock_prot_inuse_add and _get.
[firefly-linux-kernel-4.4.55.git]
/
net
/
core
/
scm.c
diff --git
a/net/core/scm.c
b/net/core/scm.c
index 100ba6d9d478d7df1082a3790ddfac0e6c012d73..10f5c65f6a470cc914de500b43d63990e89db1b6 100644
(file)
--- a/
net/core/scm.c
+++ b/
net/core/scm.c
@@
-196,6
+196,8
@@
int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
if (copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr)))
goto out;
cmlen = CMSG_SPACE(len);
+ if (msg->msg_controllen < cmlen)
+ cmlen = msg->msg_controllen;
msg->msg_control += cmlen;
msg->msg_controllen -= cmlen;
err = 0;