Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968354AbdIZLae (ORCPT ); Tue, 26 Sep 2017 07:30:34 -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 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1152 Lines: 40 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); -- 2.14.1