提交 81daa406 编写于 作者: H Hamish Martin 提交者: Greg Kroah-Hartman

uio: Reduce return paths from uio_write()

Drive all return paths for uio_write() through a single block at the
end of the function.
Signed-off-by: NHamish Martin <hamish.martin@alliedtelesis.co.nz>
Reviewed-by: NChris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f59acbc5
......@@ -568,20 +568,29 @@ static ssize_t uio_write(struct file *filep, const char __user *buf,
ssize_t retval;
s32 irq_on;
if (!idev->info->irq)
return -EIO;
if (!idev->info->irq) {
retval = -EIO;
goto out;
}
if (count != sizeof(s32))
return -EINVAL;
if (count != sizeof(s32)) {
retval = -EINVAL;
goto out;
}
if (!idev->info->irqcontrol)
return -ENOSYS;
if (!idev->info->irqcontrol) {
retval = -ENOSYS;
goto out;
}
if (copy_from_user(&irq_on, buf, count))
return -EFAULT;
if (copy_from_user(&irq_on, buf, count)) {
retval = -EFAULT;
goto out;
}
retval = idev->info->irqcontrol(idev->info, irq_on);
out:
return retval ? retval : sizeof(s32);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册