diff options
Diffstat (limited to 'net/compat.c')
-rw-r--r-- | net/compat.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/compat.c b/net/compat.c index d74d82155d78..377e560ab5c9 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -254,6 +254,8 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat | |||
254 | if (copy_to_user(CMSG_COMPAT_DATA(cm), data, cmlen - sizeof(struct compat_cmsghdr))) | 254 | if (copy_to_user(CMSG_COMPAT_DATA(cm), data, cmlen - sizeof(struct compat_cmsghdr))) |
255 | return -EFAULT; | 255 | return -EFAULT; |
256 | cmlen = CMSG_COMPAT_SPACE(len); | 256 | cmlen = CMSG_COMPAT_SPACE(len); |
257 | if (kmsg->msg_controllen < cmlen) | ||
258 | cmlen = kmsg->msg_controllen; | ||
257 | kmsg->msg_control += cmlen; | 259 | kmsg->msg_control += cmlen; |
258 | kmsg->msg_controllen -= cmlen; | 260 | kmsg->msg_controllen -= cmlen; |
259 | return 0; | 261 | return 0; |