diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 6972d242fbdfa429836979a1ca10bff227c70c1d..d92bc3eb7afcb33f398dbf35a3e4bc8f2c0c5393 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)