From patchwork Mon Dec 1 22:35:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 5415671 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7D4819F319 for ; Mon, 1 Dec 2014 22:37:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD8F820274 for ; Mon, 1 Dec 2014 22:37:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE9FA200EC for ; Mon, 1 Dec 2014 22:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932669AbaLAWgL (ORCPT ); Mon, 1 Dec 2014 17:36:11 -0500 Received: from mout.web.de ([212.227.17.11]:55468 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932636AbaLAWgI (ORCPT ); Mon, 1 Dec 2014 17:36:08 -0500 Received: from [192.168.1.2] ([78.48.162.200]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0M1X9B-1YB1zc1Ktl-00tTzc; Mon, 01 Dec 2014 23:36:01 +0100 Message-ID: <547CED4A.9000207@users.sourceforge.net> Date: Mon, 01 Dec 2014 23:35:54 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.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] mn88473: One function call less in mn88473_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> <547CEBF5.4040004@users.sourceforge.net> In-Reply-To: <547CEBF5.4040004@users.sourceforge.net> X-Provags-ID: V03:K0:b6zOUHHH5owZzw6MxhpoUHK0M3qlX9J7Z5wuauNDzaV/ON/vzKC stTL5blL/+EGr1Csd7Qvbvpq4UPy1YqNVZoGPQOXR8MWUEe7d5EImKD3qxcPOXSG9fCDUjk JgfK6plnNrZXnuoLYELpszW52tBt+eSisCxeWjchvChJbA2PtK2HC6yTE3Nt6g/V1fY7mgP RIIDmqeuAvodEuztcG1nA== 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=unavailable 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: Mon, 1 Dec 2014 23:15:20 +0100 The release_firmware() function was called by the mn88473_init() function even if a previous function call "request_firmware" failed. This implementation detail could be improved by the introduction of another jump label. Signed-off-by: Markus Elfring --- drivers/staging/media/mn88473/mn88473.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/mn88473/mn88473.c b/drivers/staging/media/mn88473/mn88473.c index 52180bb..a333744 100644 --- a/drivers/staging/media/mn88473/mn88473.c +++ b/drivers/staging/media/mn88473/mn88473.c @@ -225,7 +225,7 @@ static int mn88473_init(struct dvb_frontend *fe) ret = request_firmware(&fw, fw_file, &client->dev); if (ret) { dev_err(&client->dev, "firmare file '%s' not found\n", fw_file); - goto err; + goto err_request_firmware; } dev_info(&client->dev, "downloading firmware from file '%s'\n", @@ -261,9 +261,10 @@ static int mn88473_init(struct dvb_frontend *fe) dev->warm = true; return 0; + err: release_firmware(fw); - +err_request_firmware: dev_dbg(&client->dev, "failed=%d\n", ret); return ret; }