mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
ipc: lost unlock and fput in mqueue.c on error path
The error path in sys_mq_getsetattr() after the call to audit_mq_getsetattr() is wrong - the info->lock is not unlocked and the struct file *filp is not put. Fix them both. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: Pierre Peiffer <pierre.peiffer@bull.net> Cc: Nadia Derbey <Nadia.Derbey@bull.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
75d427982f
commit
fd79b77117
1 changed files with 4 additions and 2 deletions
|
@ -1138,8 +1138,10 @@ asmlinkage long sys_mq_getsetattr(mqd_t mqdes,
|
||||||
omqstat.mq_flags = filp->f_flags & O_NONBLOCK;
|
omqstat.mq_flags = filp->f_flags & O_NONBLOCK;
|
||||||
if (u_mqstat) {
|
if (u_mqstat) {
|
||||||
ret = audit_mq_getsetattr(mqdes, &mqstat);
|
ret = audit_mq_getsetattr(mqdes, &mqstat);
|
||||||
if (ret != 0)
|
if (ret != 0) {
|
||||||
goto out;
|
spin_unlock(&info->lock);
|
||||||
|
goto out_fput;
|
||||||
|
}
|
||||||
if (mqstat.mq_flags & O_NONBLOCK)
|
if (mqstat.mq_flags & O_NONBLOCK)
|
||||||
filp->f_flags |= O_NONBLOCK;
|
filp->f_flags |= O_NONBLOCK;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue