From patchwork Sun Feb 1 19:18:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 5757521 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5F6A0BF440 for ; Sun, 1 Feb 2015 19:18:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 884B72020E for ; Sun, 1 Feb 2015 19:18:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4425201F4 for ; Sun, 1 Feb 2015 19:18:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754100AbbBATSh (ORCPT ); Sun, 1 Feb 2015 14:18:37 -0500 Received: from mout.web.de ([212.227.17.11]:58747 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752323AbbBATSf (ORCPT ); Sun, 1 Feb 2015 14:18:35 -0500 Received: from [192.168.1.2] ([92.228.138.179]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0M1G68-1XP42N43my-00tGRz; Sun, 01 Feb 2015 20:18:28 +0100 Message-ID: <54CE7BF7.20204@users.sourceforge.net> Date: Sun, 01 Feb 2015 20:18:15 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Antti Palosaari , Greg Kroah-Hartman , Mauro Carvalho Chehab , devel@driverdev.osuosl.org, linux-media@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH 2/2] [media] mn88472: One function call less in mn88472_init() after error detection References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <54CE7A6E.104@users.sourceforge.net> In-Reply-To: <54CE7A6E.104@users.sourceforge.net> X-Provags-ID: V03:K0:KntUnSP1Tg25Ckw+XF7msX+8GoKkhVEnIBBQAQdg9CXWXsrZsrh 6DeAU0hb7f81XINbtpW3Phw9kmIR1w97UYoiC++VoxzGk743i6zqFxpA3UlZRANS+9e4slM F86Bg9/lTzfaL8EnfX9LkH42BOcpDzhvwSsZ3wibGLWQJnfcmlA5jvXo8EO04TIxhLNBqL8 l6lCmja3jowyfusdLGWkQ== X-UI-Out-Filterresults: notjunk:1; Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 1 Feb 2015 19:34:37 +0100 The release_firmware() function was called in three cases by the mn88472_init() function during error handling even if the passed variable "fw" contained still a null pointer. This implementation detail could be improved by the introduction of another jump label. Signed-off-by: Markus Elfring --- drivers/staging/media/mn88472/mn88472.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c index e7874ae..3975a57 100644 --- a/drivers/staging/media/mn88472/mn88472.c +++ b/drivers/staging/media/mn88472/mn88472.c @@ -286,7 +286,7 @@ static int mn88472_init(struct dvb_frontend *fe) ret = regmap_write(dev->regmap[0], 0xf5, 0x03); if (ret) - goto err; + goto firmware_release; for (remaining = fw->size; remaining > 0; remaining -= (dev->i2c_wr_max - 1)) { @@ -299,13 +299,13 @@ static int mn88472_init(struct dvb_frontend *fe) if (ret) { dev_err(&client->dev, "firmware download failed=%d\n", ret); - goto err; + goto firmware_release; } } ret = regmap_write(dev->regmap[0], 0xf5, 0x00); if (ret) - goto err; + goto firmware_release; release_firmware(fw); fw = NULL; @@ -314,9 +314,9 @@ static int mn88472_init(struct dvb_frontend *fe) dev->warm = true; return 0; -err: +firmware_release: release_firmware(fw); - +err: dev_dbg(&client->dev, "failed=%d\n", ret); return ret; }