diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/scm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/scm.c b/net/core/scm.c index 100ba6d9d47..10f5c65f6a4 100644 --- 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) | |||
196 | if (copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr))) | 196 | if (copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr))) |
197 | goto out; | 197 | goto out; |
198 | cmlen = CMSG_SPACE(len); | 198 | cmlen = CMSG_SPACE(len); |
199 | if (msg->msg_controllen < cmlen) | ||
200 | cmlen = msg->msg_controllen; | ||
199 | msg->msg_control += cmlen; | 201 | msg->msg_control += cmlen; |
200 | msg->msg_controllen -= cmlen; | 202 | msg->msg_controllen -= cmlen; |
201 | err = 0; | 203 | err = 0; |