summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_mqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/uipc_mqueue.c')
-rw-r--r--sys/kern/uipc_mqueue.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c
index a04569e..4886501 100644
--- a/sys/kern/uipc_mqueue.c
+++ b/sys/kern/uipc_mqueue.c
@@ -2242,10 +2242,10 @@ sys_kmq_setattr(struct thread *td, struct kmq_setattr_args *uap)
}
error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL,
&oattr);
- if (error != 0)
- return (error);
- if (uap->oattr != NULL)
+ if (error == 0 && uap->oattr != NULL) {
+ bzero(oattr.__reserved, sizeof(oattr.__reserved));
error = copyout(&oattr, uap->oattr, sizeof(oattr));
+ }
return (error);
}
@@ -2759,10 +2759,9 @@ freebsd32_kmq_setattr(struct thread *td, struct freebsd32_kmq_setattr_args *uap)
}
error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL,
&oattr);
- if (error != 0)
- return (error);
- if (uap->oattr != NULL) {
+ if (error == 0 && uap->oattr != NULL) {
mq_attr_to32(&oattr, &oattr32);
+ bzero(oattr32.__reserved, sizeof(oattr32.__reserved));
error = copyout(&oattr32, uap->oattr, sizeof(oattr32));
}
return (error);
OpenPOWER on IntegriCloud