ncpfs: return proper error from NCP_IOC_SETROOT ioctl
authorJan Kara <jack@suse.cz>
Wed, 10 Dec 2014 23:52:22 +0000 (15:52 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 17:58:17 +0000 (09:58 -0800)
commitcb22aba0ee2bc330033b85447b4d44b1501ee75f
tree23b30cb7dab88bd7be8920bb8ddab95c3d51b530
parent3d53f1f7166c4bc5e936155de143676bf5fc7b0c
ncpfs: return proper error from NCP_IOC_SETROOT ioctl

commit a682e9c28cac152e6e54c39efcf046e0c8cfcf63 upstream.

If some error happens in NCP_IOC_SETROOT ioctl, the appropriate error
return value is then (in most cases) just overwritten before we return.
This can result in reporting success to userspace although error happened.

This bug was introduced by commit 2e54eb96e2c8 ("BKL: Remove BKL from
ncpfs").  Propagate the errors correctly.

Coverity id: 1226925.

Fixes: 2e54eb96e2c80 ("BKL: Remove BKL from ncpfs")
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Petr Vandrovec <petr@vandrovec.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ncpfs/ioctl.c