]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - kernel/audit.c
audit: Do not send uninitialized data for AUDIT_TTY_GET
[net-next-2.6.git] / kernel / audit.c
index 8429afea37bf76f3ae57bf86c4ceda8cf9acbda2..57f4038694d15dc193dd78c694a5635153a65aae 100644 (file)
@@ -884,8 +884,10 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                        spin_unlock_irq(&tsk->sighand->siglock);
                }
                read_unlock(&tasklist_lock);
-               audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_TTY_GET, 0, 0,
-                                &s, sizeof(s));
+
+               if (!err)
+                       audit_send_reply(NETLINK_CB(skb).pid, seq,
+                                        AUDIT_TTY_GET, 0, 0, &s, sizeof(s));
                break;
        }
        case AUDIT_TTY_SET: {