Re: [PATCH 2/2] [media] avoid double locks with graph_mutex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mauro,

On Tue, Mar 29, 2016 at 06:28:27AM -0300, Mauro Carvalho Chehab wrote:
> Em Tue, 29 Mar 2016 06:17:34 -0300
> Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx> escreveu:
> 
> > > > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> > > > index 6cfa890af7b4..6af5e6932271 100644
> > > > --- a/drivers/media/media-device.c
> > > > +++ b/drivers/media/media-device.c
> > > > @@ -93,7 +93,6 @@ static struct media_entity *find_entity(struct media_device *mdev, u32 id)
> > > >  	media_device_for_each_entity(entity, mdev) {
> > > >  		if (((media_entity_id(entity) == id) && !next) ||
> > > >  		    ((media_entity_id(entity) > id) && next)) {
> > > > -			mutex_unlock(&mdev->graph_mutex);    
> > > 
> > > Unrelated to this patch.  
> > 
> > Yes. This belongs to patch 1.
> > 
> > > 
> > > Please do also consider compat IOCTL handling code.
> > >   
> 
> Sorry, I forgot to mention this one on my previous email.
> 
> Compat32 handling is just:
> 
>         switch (cmd) {
>        	case MEDIA_IOC_ENUM_LINKS32:
>                	mutex_lock(&dev->graph_mutex);
>                 ret = media_device_enum_links32(dev,
>                                 (struct media_links_enum32 __user *)arg);
>                	mutex_unlock(&dev->graph_mutex);
>                 break;
> 
>         default:
>                 return media_device_ioctl(filp, cmd, arg);
>         }
> 
> and media_device_enum_links32() doesn't call an function with a
> mutex. So, it is safe.

I agree. I noticed I had some leftover cruft in my working tree...

-- 
Sakari Ailus
e-mail: sakari.ailus@xxxxxx	XMPP: sailus@xxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux