diff --git a/security/apparmor/notify.c b/security/apparmor/notify.c index e1c5697f79c7..6b5ab25c92d7 100644 --- a/security/apparmor/notify.c +++ b/security/apparmor/notify.c @@ -971,10 +971,10 @@ static long build_v3_unotif(struct aa_knotif *knotif, void __user *buf, pos = buf + sizeof(unotif); if (!build_append_str(buf, pos, max_size, profile->base.hname, unotif.op.label, size)) - return size; + return -EMSGSIZE; if (!build_append_str(buf, pos, max_size, knotif->ad->name, unotif.file.name, size)) - return size; + return -EMSGSIZE; /* set size after appending strings */ unotif.common.len = size;