lkml.org 
[lkml]   [2009]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: double unlock in rng_dev_read()
On Wed, Dec 23, 2009 at 10:36:58PM +0800, Herbert Xu wrote:
> On Wed, Dec 23, 2009 at 03:15:52PM +0200, Dan Carpenter wrote:
> > It seems like we unlock rng_mutex twice (2.6.33-rc1).
> >
> > drivers/char/hw_random/core.c
> > 151 mutex_unlock(&rng_mutex);
> > 152
> > 153 if (need_resched())
> > 154 schedule_timeout_interruptible(1);
> > 155
> > 156 if (signal_pending(current)) {
> > 157 err = -ERESTARTSYS;
> > 158 goto out;
> > 159 }
> > 160 }
> > 161 out_unlock:
> > 162 mutex_unlock(&rng_mutex);
>
> Hmm, are you sure you didn't mistake out for out_unlock? :)

No no. I mean when size hits zero we are rng_mutex is unlocked.

regards,
dan carpenter

> --
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


\
 
 \ /
  Last update: 2009-12-23 15:57    [W:0.047 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site