From patchwork Sat Aug 12 17:30:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 9897431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DFDA4603B4 for ; Sat, 12 Aug 2017 18:17:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8FB328984 for ; Sat, 12 Aug 2017 18:17:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD1D3289AF; Sat, 12 Aug 2017 18:17:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E3F528984 for ; Sat, 12 Aug 2017 18:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752147AbdHLSRE (ORCPT ); Sat, 12 Aug 2017 14:17:04 -0400 Received: from gateway36.websitewelcome.com ([50.116.125.2]:18925 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752095AbdHLSRD (ORCPT ); Sat, 12 Aug 2017 14:17:03 -0400 X-Greylist: delayed 1500 seconds by postgrey-1.27 at vger.kernel.org; Sat, 12 Aug 2017 14:17:03 EDT Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway36.websitewelcome.com (Postfix) with ESMTP id D24D34013C1A0 for ; Sat, 12 Aug 2017 12:31:00 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id gaF1dv1vnyM9ygaF1dj1Zr; Sat, 12 Aug 2017 12:30:27 -0500 Received: from [187.192.74.87] (port=42730 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1dgaFY-000NJV-9o; Sat, 12 Aug 2017 12:31:00 -0500 Date: Sat, 12 Aug 2017 12:30:59 -0500 From: "Gustavo A. R. Silva" To: Mauro Carvalho Chehab Cc: Julia Lawall , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] au0828: fix unbalanced lock/unlock in au0828_usb_probe Message-ID: <20170812173059.GA20047@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.192.74.87 X-Exim-ID: 1dgaFY-000NJV-9o X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [187.192.74.87]:42730 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 3 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Call mutex_unlock and free dev on failure. Reported-by: Julia Lawall Signed-off-by: Gustavo A. R. Silva --- drivers/media/usb/au0828/au0828-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index 739df61..cd363a2 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -628,6 +628,8 @@ static int au0828_usb_probe(struct usb_interface *interface, if (retval) { pr_err("%s() au0282_dev_register failed to register on V4L2\n", __func__); + mutex_unlock(&dev->lock); + kfree(dev); goto done; }