From patchwork Sun Nov 30 20:28:40 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: 5409331 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 08AEBBEEA8 for ; Sun, 30 Nov 2014 20:29:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35282201DD for ; Sun, 30 Nov 2014 20:29:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D1802017A for ; Sun, 30 Nov 2014 20:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752471AbaK3U26 (ORCPT ); Sun, 30 Nov 2014 15:28:58 -0500 Received: from mout.web.de ([212.227.15.3]:55139 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752021AbaK3U25 (ORCPT ); Sun, 30 Nov 2014 15:28:57 -0500 Received: from [192.168.1.2] ([78.49.11.120]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MaJc8-1XbIoT0n6G-00Jtvq; Sun, 30 Nov 2014 21:28:49 +0100 Message-ID: <547B7DF8.8020601@users.sourceforge.net> Date: Sun, 30 Nov 2014 21:28:40 +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 2/2] [media] tuners-si2157: One function call less in si2157_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> <547B7C36.1070600@users.sourceforge.net> In-Reply-To: <547B7C36.1070600@users.sourceforge.net> X-Provags-ID: V03:K0:VLanTlNKvVoTxg92Lm6d81kGNjwT7ItBWH6H4nPSr4tCwXsdLRG 0aXvDKboanqAmqrS2acdtK4pIB48K+CHWCLGJbXLSBPW4buy9s/hHxcTzyw6xs/FOMwzr7E EqXJAU7DozbgXvISYzFt15AGluOrdPNqFjP3mLDMVw9/F5T1f8K1uCEQgVHkv7SLjLoaLP2 VMdiaSakWLxUVkvIq5uow== 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: Sun, 30 Nov 2014 20:48:24 +0100 The release_firmware() function was called in some cases by the si2157_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/tuners/si2157.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index e17ab1f..2180de9 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -157,7 +157,7 @@ static int si2157_init(struct dvb_frontend *fe) dev_err(&s->client->dev, "firmware file '%s' is invalid\n", fw_file); ret = -EINVAL; - goto err; + goto fw_release_exit; } dev_info(&s->client->dev, "downloading firmware from file '%s'\n", @@ -173,7 +173,7 @@ static int si2157_init(struct dvb_frontend *fe) dev_err(&s->client->dev, "firmware download failed=%d\n", ret); - goto err; + goto fw_release_exit; } } @@ -195,9 +195,9 @@ warm: s->active = true; return 0; -err: +fw_release_exit: release_firmware(fw); - +err: dev_dbg(&s->client->dev, "failed=%d\n", ret); return ret; }