diff options
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r-- | drivers/char/hw_random/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 84cdf9025737..349b6edc5794 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c | |||
@@ -116,6 +116,10 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf, | |||
116 | err = -EAGAIN; | 116 | err = -EAGAIN; |
117 | if (!bytes_read && (filp->f_flags & O_NONBLOCK)) | 117 | if (!bytes_read && (filp->f_flags & O_NONBLOCK)) |
118 | goto out; | 118 | goto out; |
119 | if (bytes_read < 0) { | ||
120 | err = bytes_read; | ||
121 | goto out; | ||
122 | } | ||
119 | 123 | ||
120 | err = -EFAULT; | 124 | err = -EFAULT; |
121 | while (bytes_read && size) { | 125 | while (bytes_read && size) { |