提交 83ae1b79 编写于 作者: A Andreas Schwab 提交者: 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: NAndreas Schwab <schwab@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a3e09756
...@@ -684,8 +684,10 @@ static int hdio_getgeo(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -684,8 +684,10 @@ static int hdio_getgeo(unsigned int fd, unsigned int cmd, unsigned long arg)
if (!err) { if (!err) {
err = copy_to_user (ugeo, &geo, 4); err = copy_to_user (ugeo, &geo, 4);
err |= __put_user (geo.start, &ugeo->start); 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) static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册