From patchwork Thu Nov 20 08:39:27 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: 5346631 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C9A72C11AC for ; Thu, 20 Nov 2014 08:40:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F23522021F for ; Thu, 20 Nov 2014 08:40:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 131B7201F2 for ; Thu, 20 Nov 2014 08:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756821AbaKTIj6 (ORCPT ); Thu, 20 Nov 2014 03:39:58 -0500 Received: from mout.web.de ([212.227.17.12]:52435 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751377AbaKTIj5 (ORCPT ); Thu, 20 Nov 2014 03:39:57 -0500 Received: from [192.168.1.2] ([78.48.101.99]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MIvPJ-1XotMr1AzZ-002bO6; Thu, 20 Nov 2014 09:39:40 +0100 Message-ID: <546DA8BF.70005@users.sourceforge.net> Date: Thu, 20 Nov 2014 09:39:27 +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 , Mauro Carvalho Chehab , linux-media@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH 3/3] [media] si2168: One function call less in si2168_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> <546DA419.7050405@users.sourceforge.net> In-Reply-To: <546DA419.7050405@users.sourceforge.net> X-Provags-ID: V03:K0:rCRalrcfXkxdxLrAN2C9QNaa7SH3haOq3pAdSkF+np+d6mfyeDW GEmpIbCD21e/ZFdpg82cxyW/6uJjb2MYnR++yOb8plHBvjSUZjXGJaAHMtLj/zCpuVv/72G FZ1KGGezSs9EmgHYCmSW6ASshJ/zGiQWSNrtkIPBaQj6b1cNvQ/k2JFG7kHwnPYubhKdPuw 9xChEinSJ0evx+6l/2JIA== 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: Wed, 19 Nov 2014 23:23:15 +0100 The release_firmware() function was called in some cases by the si2168_init() function during error handling even if the passed variable contained still a null pointer. This implementation detail could be improved by the introduction of another jump label. Signed-off-by: Markus Elfring --- drivers/media/dvb-frontends/si2168.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index 6a455f9..b8c6372 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c @@ -428,7 +428,7 @@ static int si2168_init(struct dvb_frontend *fe) dev_err(&s->client->dev, "%s: firmware file '%s' not found\n", KBUILD_MODNAME, fw_file); - goto err; + goto error_fw_release; } } @@ -448,7 +448,7 @@ static int si2168_init(struct dvb_frontend *fe) dev_err(&s->client->dev, "%s: firmware download failed=%d\n", KBUILD_MODNAME, ret); - goto err; + goto error_fw_release; } } @@ -468,9 +468,10 @@ static int si2168_init(struct dvb_frontend *fe) s->active = true; return 0; -err: - release_firmware(fw); +error_fw_release: + release_firmware(fw); +err: dev_dbg(&s->client->dev, "%s: failed=%d\n", __func__, ret); return ret; }