From: Mark Haverkamp Date: Mon, 12 Jun 2006 17:53:58 +0000 (-0700) Subject: [SCSI] aacraid: Fix return code interpretation X-Git-Tag: v2.6.18-rc1~1092^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=821499a8241019be5591fad5ab925759fbcd9f32;p=linux-2.6 [SCSI] aacraid: Fix return code interpretation Received from Mark Salyzyn clear_user return is 0 for success, the code fragment is written to assume that it is the count of the number of bytes zero'd. Signed-off-by: Mark Haverkamp Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 9647dabc66..03fe2abcc4 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -564,7 +564,7 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long f = compat_alloc_user_space(sizeof(*f)); ret = 0; - if (clear_user(f, sizeof(*f)) != sizeof(*f)) + if (clear_user(f, sizeof(*f))) ret = -EFAULT; if (copy_in_user(f, (void __user *)arg, sizeof(struct fib_ioctl) - sizeof(u32))) ret = -EFAULT;