From patchwork Fri Jan 4 18:56:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1934301 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E743D3FDDA for ; Fri, 4 Jan 2013 18:56:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754257Ab3ADS4Y (ORCPT ); Fri, 4 Jan 2013 13:56:24 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:22438 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753631Ab3ADS4W (ORCPT ); Fri, 4 Jan 2013 13:56:22 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id r04IuBKU032088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Jan 2013 18:56:11 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r04Iu9B6013635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Jan 2013 18:56:10 GMT Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r04Iu8Rs001994; Fri, 4 Jan 2013 12:56:08 -0600 Received: from elgon.mountain (/41.212.103.53) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 04 Jan 2013 10:56:08 -0800 Date: Fri, 4 Jan 2013 21:56:02 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Nikolaus Schulz , Michael Krufky , linux-media@vger.kernel.org, kbuild@01.org, kernel-janitors@vger.kernel.org Subject: [patch] [media] dvb: unlock on error in dvb_ca_en50221_io_do_ioctl() Message-ID: <20130104185602.GB2038@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <50e3bfe0.IJT/Tw4ZVUbERlpE%fengguang.wu@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org We recently pushed the locking down into this function, but there was an error path where the unlock was missed. Signed-off-by: Dan Carpenter --- Only needed in linux-next. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c index 190e5e0..0aac309 100644 --- a/drivers/media/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb-core/dvb_ca_en50221.c @@ -1227,8 +1227,10 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file, case CA_GET_SLOT_INFO: { struct ca_slot_info *info = parg; - if ((info->num > ca->slot_count) || (info->num < 0)) - return -EINVAL; + if ((info->num > ca->slot_count) || (info->num < 0)) { + err = -EINVAL; + goto out_unlock; + } info->type = CA_CI_LINK; info->flags = 0; @@ -1247,6 +1249,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file, break; } +out_unlock: mutex_unlock(&ca->ioctl_mutex); return err; }