From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from aserp1040.oracle.com ([141.146.126.69]:47101 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755511Ab2K0Rfb (ORCPT ); Tue, 27 Nov 2012 12:35:31 -0500 Date: Tue, 27 Nov 2012 20:35:09 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Douglas Bagnall , David =?iso-8859-1?Q?H=E4rdeman?= , Jarod Wilson , Ezequiel Garcia , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch 1/2] [media] rc: unlock on error in show_protocols() Message-ID: <20121127173509.GE1059@elgon.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-media-owner@vger.kernel.org List-ID: We recently introduced a new return -ENODEV in this function but we need to unlock before returning. 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,