diff options
Diffstat (limited to 'include/net/scm.h')
-rw-r--r-- | include/net/scm.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/net/scm.h b/include/net/scm.h index 745460fa2f02..d456f4c71a32 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -49,7 +49,7 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm, | |||
49 | struct pid *pid, const struct cred *cred) | 49 | struct pid *pid, const struct cred *cred) |
50 | { | 50 | { |
51 | scm->pid = get_pid(pid); | 51 | scm->pid = get_pid(pid); |
52 | scm->cred = get_cred(cred); | 52 | scm->cred = cred ? get_cred(cred) : NULL; |
53 | cred_to_ucred(pid, cred, &scm->creds); | 53 | cred_to_ucred(pid, cred, &scm->creds); |
54 | } | 54 | } |
55 | 55 | ||
@@ -73,8 +73,7 @@ static __inline__ void scm_destroy(struct scm_cookie *scm) | |||
73 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, | 73 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, |
74 | struct scm_cookie *scm) | 74 | struct scm_cookie *scm) |
75 | { | 75 | { |
76 | scm_set_cred(scm, task_tgid(current), current_cred()); | 76 | memset(scm, 0, sizeof(*scm)); |
77 | scm->fp = NULL; | ||
78 | unix_get_peersec_dgram(sock, scm); | 77 | unix_get_peersec_dgram(sock, scm); |
79 | if (msg->msg_controllen <= 0) | 78 | if (msg->msg_controllen <= 0) |
80 | return 0; | 79 | return 0; |