From: Douglas Bagnall Date: Tue, 27 Nov 2012 19:51:48 +0000 Subject: Re: [patch 1/2] [media] rc: unlock on error in show_protocols() Message-Id: <50B519D4.7050904@paradise.net.nz> List-Id: References: <20121127173509.GE1059@elgon.mountain> In-Reply-To: <20121127173509.GE1059@elgon.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: Mauro Carvalho Chehab , =?UTF-8?B?RGF2aWQgSMOkcmRl?= =?UTF-8?B?bWFu?= , Jarod Wilson , Ezequiel Garcia , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org On 28/11/12 06:35, Dan Carpenter wrote: > We recently introduced a new return -ENODEV in this function but we need > to unlock before returning. There is an identical patch here (scroll down): https://patchwork.kernel.org/patch/1284081/ I'm not sure what happened to it. Douglas > Signed-off-by: Dan Carpenter > > diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c > index 601d1ac1..d593bc6 100644 > --- a/drivers/media/rc/rc-main.c > +++ b/drivers/media/rc/rc-main.c > @@ -789,8 +789,10 @@ static ssize_t show_protocols(struct device *device, > } else if (dev->raw) { > enabled = dev->raw->enabled_protocols; > allowed = ir_raw_get_allowed_protocols(); > - } else > + } else { > + mutex_unlock(&dev->lock); > return -ENODEV; > + } > > IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n", > (long long)allowed, >