Commit 83ae1b79 authored by Andreas Schwab's avatar Andreas Schwab Committed by Linus Torvalds

Fix error handling in HDIO_GETGEO compat wrapper

Don't clobber error from sys_ioctl in HDIO_GETGEO compat wrapper.
Signed-off-by: default avatarAndreas Schwab <schwab@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a3e09756
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment