diff options
author | Andreas Schwab <schwab@suse.de> | 2007-05-08 00:31:38 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 11:15:14 -0700 |
commit | 83ae1b79c898838e16ac8cde69b39d22d36fb035 (patch) | |
tree | e7571f14e4167f4425b8b05ed2cf3b59c8b383b5 | |
parent | a3e0975684337738997771416535d0e5d6fa27cd (diff) | |
download | op-kernel-dev-83ae1b79c898838e16ac8cde69b39d22d36fb035.zip op-kernel-dev-83ae1b79c898838e16ac8cde69b39d22d36fb035.tar.gz |
Fix error handling in HDIO_GETGEO compat wrapper
Don't clobber error from sys_ioctl in HDIO_GETGEO compat wrapper.
Signed-off-by: Andreas Schwab <schwab@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/compat_ioctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 6972d24..d92bc3e 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -684,8 +684,10 @@ static int hdio_getgeo(unsigned int fd, unsigned int cmd, unsigned long arg) if (!err) { err = copy_to_user (ugeo, &geo, 4); err |= __put_user (geo.start, &ugeo->start); + if (err) + err = -EFAULT; } - return err ? -EFAULT : 0; + return err; } static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) |