From patchwork Tue Sep 26 11:30:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9971753 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 C81C3602BD for ; Tue, 26 Sep 2017 11:30:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C89B728BF1 for ; Tue, 26 Sep 2017 11:30:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC23428CEB; Tue, 26 Sep 2017 11:30:47 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 7A93428B5D for ; Tue, 26 Sep 2017 11:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968310AbdIZLad (ORCPT ); Tue, 26 Sep 2017 07:30:33 -0400 Received: from mout.web.de ([217.72.192.78]:53976 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965748AbdIZLab (ORCPT ); Tue, 26 Sep 2017 07:30:31 -0400 Received: from [192.168.1.2] ([78.54.205.15]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lj2I6-1dM5fw3Dd0-00dIuJ; Tue, 26 Sep 2017 13:30:26 +0200 Subject: [PATCH 3/6] [media] tda8261: Return directly after a failed kzalloc() in tda8261_attach() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann Cc: LKML , kernel-janitors@vger.kernel.org References: <15d74bee-7467-4687-24e1-3501c22f6d75@users.sourceforge.net> Message-ID: <6613af47-7855-2633-e4dd-40b259cb4dc4@users.sourceforge.net> Date: Tue, 26 Sep 2017 13:30:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <15d74bee-7467-4687-24e1-3501c22f6d75@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:CkI1j6igk23DgqoYEjiy1olLdYbH65j6gUoJ3tGgCXwQK95Pgia wpayQrpHA3v6WJ1gXnd8WNjRk52syMuhRRPdkcagNYXWMuP8jXwIi6koWB+hXB6CO6dONo0 hrdVUDeJ7jD4SSVwgqbnJiD9fyb+Dl5Y+UlA6TLJ2g2h21rH4f7U7cBSPlRSNTsCchqvDKa zbggBhtJ7xjwGXthJwiMA== X-UI-Out-Filterresults: notjunk:1; V01:K0:0sLY+i3uCdw=:REjMBbOpkuDNzC/7nYWhiK JBz3RDS9eZ/bt6FcPxgwlisx2KwYOIVt49hmDxIIpFCFznGX1Lft8sAflblRc2jX9koKQVBrE eCTPJCnW2/gMAL8Y+DId5QppLQEPw/t1LOYbUsaPibX9hJJgOBrA97frIS7V1f0GNri5G5z84 Q58gk9VpDm62HgemcYZd5zxKQZVCXcMMP7+BJLf7kUrs/KpKKTrEVW0JEFTkOmrclT+CVH/3b maZCiqUpdJqaDBpj5WjIcZEu+gb2rxihklpMkleLuf6k8egnm4hXHgqO1ibF6DLMCUU52kyA1 2ODvKBST+sRp/7TUZiNRe07MGECj9Ln+n9V8amm9jtDPv/YYKptPJLwoV2seaHLycHt59yrUI 488b41v+N9s4IU1GmPtVzt3OPZliANb2Yz3zpENkMnw9hVtK1S3JOQDT7baItIdZhjsXjuz2W uMJvjD+2JCwtxmlIDbrkB7in5Kq62FcRMq1KV6P5oA2AUFKQ2oMLHcNscFhaQfOKX07FjoqUO 65LyQmD8PWNUxXAEGaaDvtl74NbIMCTWg07H8rlDJ4hHg5AQofncQUoOeTRQ+b0ErdDKTt5Ai LHJPKwFvmxn2TtyudMwORGwOG8g91UqJyg5yBdoUqT5S3WBv+5Teq12fF1VZexvOE9GTUJ7TQ g+po74jGEVbmFF0iF6oyjVkxwLMmg1rWI31NyajKMa7hRt+vq7bJ67hX2kZaoQVIqIHf7UD+O tE0wj1M+mwDuQ+nUEJpQF+jrqr6xvOBB1n/yOgwJgsuxMVrUmvOasj3nOLU78TZzx5Lr2vJOm qJYUi6aVk+Zv8QW9h3hCQmsTvP+BB+Saeh2hqwy1K8R3NmKRHA= 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 From: Markus Elfring Date: Tue, 26 Sep 2017 12:20:33 +0200 * Return directly after a call of the function "kzalloc" failed at the beginning. * Delete a call of the function "kfree" and the jump target "exit" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/media/dvb-frontends/tda8261.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/media/dvb-frontends/tda8261.c b/drivers/media/dvb-frontends/tda8261.c index 5269a170c84e..e3b4183d00c2 100644 --- a/drivers/media/dvb-frontends/tda8261.c +++ b/drivers/media/dvb-frontends/tda8261.c @@ -187,7 +187,7 @@ struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, state = kzalloc(sizeof(*state), GFP_KERNEL); if (!state) - goto exit; + return NULL; state->config = config; state->i2c = i2c; @@ -200,10 +200,6 @@ struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, pr_info("%s: Attaching TDA8261 8PSK/QPSK tuner\n", __func__); return fe; - -exit: - kfree(state); - return NULL; } EXPORT_SYMBOL(tda8261_attach);