[S390] hw_random: allow rng_dev_read() to return hardware errors.
[safe/jmp/linux-2.6] / drivers / char / hw_random / core.c
index 84cdf90..349b6ed 100644 (file)
@@ -116,6 +116,10 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf,
                err = -EAGAIN;
                if (!bytes_read && (filp->f_flags & O_NONBLOCK))
                        goto out;
+               if (bytes_read < 0) {
+                       err = bytes_read;
+                       goto out;
+               }
 
                err = -EFAULT;
                while (bytes_read && size) {