From patchwork Tue Aug 7 22:05:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Bagnall X-Patchwork-Id: 1288501 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D54D2DF280 for ; Tue, 7 Aug 2012 22:05:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756209Ab2HGWFT (ORCPT ); Tue, 7 Aug 2012 18:05:19 -0400 Received: from smtp3.clear.net.nz ([203.97.33.64]:40967 "EHLO smtp3.clear.net.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756079Ab2HGWFR (ORCPT ); Tue, 7 Aug 2012 18:05:17 -0400 Received: from mxin3-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M8E003BJO0J8910@smtp3.clear.net.nz>; Wed, 08 Aug 2012 10:05:15 +1200 (NZST) Received: from 203-97-236-46.cable.telstraclear.net (HELO [192.168.1.42]) ([203.97.236.46]) by smtpin32.paradise.net.nz with ESMTP; Wed, 08 Aug 2012 10:05:10 +1200 Date: Wed, 08 Aug 2012 10:05:10 +1200 From: Douglas Bagnall Subject: [PATCH] [media] Unlock the rc_dev lock when the raw device is missing In-reply-to: <20120807161013.GC3922@herton-Z68MA-D2H-B3> To: Herton Ronaldo Krzesinski Cc: Ben Hutchings , stable@vger.kernel.org, Greg Kroah-Hartman , Mauro Carvalho Chehab , linux-media@vger.kernel.org Message-id: <50219116.6070103@paradise.net.nz> MIME-version: 1.0 Content-type: multipart/mixed; boundary=------------010307000605070405010405 References: <20120806173851.GE2979@herton-Z68MA-D2H-B3> <1344304698.13142.154.camel@deadeye.wl.decadent.org.uk> <5020CAB4.2080607@paradise.net.nz> <20120807161013.GC3922@herton-Z68MA-D2H-B3> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On 08/08/12 04:10, Herton Ronaldo Krzesinski wrote: > As it's desired for stable, this could also have > "Cc: stable@vger.kernel.org" when applied, so it's picked up > "automatically" when lands in mainline. Also nitpicking some more, > may be the patch could have a Reported-by line added. OK. Here it is again, with CC: stable, Reported-by Ben, and Herton's Acked-by. thanks, Douglas >From 47aadfdaa5a6e5c3d8f1bf2b5be4c4a4156085ee Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Tue, 7 Aug 2012 19:30:36 +1200 Subject: [PATCH] Unlock the rc_dev lock when the raw device is missing As pointed out by Ben Hutchings, after commit 720bb6436, the lock was being taken and not released when an rc_dev has a NULL raw device. Cc: Reported-by: Ben Hutchings Signed-off-by: Douglas Bagnall Acked-by: Herton R. Krzesinski --- drivers/media/rc/rc-main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index cabc19c..dcd45d0 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -778,9 +778,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, (long long)enabled); -- 1.7.9.5