Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1278860

Re: [PATCH] hw_random: core, sleep interruptible in read

From Jiri Slaby <jslaby@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH] hw_random: core, sleep interruptible in read
Date 2015-11-27 16:50 +0100
Message-ID <qztrB-4LC-27@gated-at.bofh.it> (permalink)
References <qzaRY-16M-5@gated-at.bofh.it> <qzqWK-3hn-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 11/27/2015, 02:06 PM, Herbert Xu wrote:
> On Thu, Nov 26, 2015 at 08:56:29PM +0100, Jiri Slaby wrote:
>>
>> diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
>> index a064237ff362..f003df162e09 100644
>> --- a/drivers/char/hw_random/core.c
>> +++ b/drivers/char/hw_random/core.c
>> @@ -238,7 +238,10 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf,
>>  			goto out;
>>  		}
>>  
>> -		mutex_lock(&reading_mutex);
>> +		if (mutex_lock_interruptible(&reading_mutex)) {
>> +			err = -EINTR;
> 
> Shouldn't this be ERESTARTSYS?

Yes, it actually can, given the retval is returned only if no data were
read yet.

thanks,
-- 
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] hw_random: core, sleep interruptible in read Jiri Slaby <jslaby@suse.cz> - 2015-11-26 21:00 +0100
  Re: [PATCH] hw_random: core, sleep interruptible in read Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-27 14:10 +0100
    Re: [PATCH] hw_random: core, sleep interruptible in read Jiri Slaby <jslaby@suse.cz> - 2015-11-27 16:50 +0100
    [PATCH v2] hw_random: core, sleep interruptible in read Jiri Slaby <jslaby@suse.cz> - 2015-11-27 17:00 +0100

csiph-web