Skip to content

Commit

Permalink
Fix error handling in HDIO_GETGEO compat wrapper
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andreas Schwab authored and Linus Torvalds committed May 8, 2007
1 parent a3e0975 commit 83ae1b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 83ae1b7

Please sign in to comment.