From patchwork Sat Jul 2 19:05:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9211011 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 9C6386075F for ; Sat, 2 Jul 2016 19:05:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8758628509 for ; Sat, 2 Jul 2016 19:05:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A16128522; Sat, 2 Jul 2016 19:05:45 +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=ham 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 1CBD428509 for ; Sat, 2 Jul 2016 19:05:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751469AbcGBTFn (ORCPT ); Sat, 2 Jul 2016 15:05:43 -0400 Received: from mout.web.de ([212.227.15.3]:64592 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752422AbcGBTFm (ORCPT ); Sat, 2 Jul 2016 15:05:42 -0400 Received: from [192.168.1.2] ([78.48.103.139]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0LaIRi-1bjSOa1EdC-00m1dF; Sat, 02 Jul 2016 21:05:38 +0200 Subject: [PATCH 1/2] Input-at32psif: Return directly after a failed kzalloc() in psif_probe() To: Dmitry Torokhov , linux-input@vger.kernel.org References: <566ABCD9.1060404@users.sourceforge.net> <4471604f-f401-bed9-39be-1aff2a92edf6@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <85f42edb-7ce5-cf23-80f5-48440a14cd94@users.sourceforge.net> Date: Sat, 2 Jul 2016 21:05:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <4471604f-f401-bed9-39be-1aff2a92edf6@users.sourceforge.net> X-Provags-ID: V03:K0:GwxnVz3UOkMeFZG9ScX/fULDsn1Y46iEWfol3BB68tLtc+7m3Vj 3ACCxNVnPlz0WFCW8eklsbB+OkznUAm+JO/4UOFKrAYJD2BIQq3LZJpWrq2A2O3cSe2EbM/ lH6sA18gZj4DOEfnLFoDwyB5cbXc66ubIGIAl/9dFmZu2YgdcxiYK3tpdg6/t5ytW7LvPbH TMLaEJpmxKzyu+ZcwZKsg== X-UI-Out-Filterresults: notjunk:1; V01:K0:eUO01JWHytM=:Jy0AkynEkVsMnmWbCp+NaL D4Ci7pOk+a9KX9mfO5HC26WTLtVt28lJeJMnnGtqAQP/1sF7myOfATR/k8O5Q6z+24uZRPimD EQGvYMTc6lYKi8SyCcjYIyfnJSG2Qa1j/vVvCkZQpq9EbefPoIyzz+EIHPdGPqh/7RlvdiLsx 4xOUypw6Dxw/weQRDD/CZPaEwtFcTCOOYPsUT/+8FE3HMwW7r7zhJ1vQNLwYHTNt4V7YclBBD LZRZOAobtpnxyRzsa1/hkWJ1rQ58OpZo2KA8KH5aYHzOuHU50vyNfuitEcG731j+lRnHXpU1e AGQDPgXA/SFJDZ9Dkvq11YfWa4rtKG0os2NHAAcbBMoKJoT5AF9fTDpk8jGKzbsF1ClJDorVS 8x9p9nmul2sZCeZYCuJM4xw2OS9FbxirBFr15pG+jNo4L2PAAV5g8UhZqtEBt9w9ntBhxMZnc 20N7HQlT8qkiIB3hKvNE63Ccl1428MzOSWx9B1AQaGzDG9+e27IelMWR5KSXBrPg94bPaOU+v syLATPwiW3zUJlL3naZrQTGlpt9KU7+Z2tu1m9LYJal/jQgEXC76/RGHYgGlvtWjzlfdpbTBY xgQdxXZme9BSG9mDgDkrJ9FgyIAD8a/+bZbY+9Tn0OmO9T9NGcgW4q6S5U6MyBmb8UGoiqTDX +D+D9W6UNNq82vos8saojAFiB/wyARmwGP9vTHUinP04euQu1/HfZgQPu2qZyjPGuvKxy6Za1 xa5DhzLZWBNgupP9+6Sd3joTctYmDxaDV/pMHkERk+bD09/7kYogKNLvHuhhLtBkqIZC4GJ7s 7MvJ11b Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 2 Jul 2016 18:34:43 +0200 Return directly after a memory allocation failed at the beginning. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/input/serio/at32psif.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c index 2e4ff5b..fcb769a 100644 --- a/drivers/input/serio/at32psif.c +++ b/drivers/input/serio/at32psif.c @@ -212,8 +212,7 @@ static int __init psif_probe(struct platform_device *pdev) psif = kzalloc(sizeof(struct psif), GFP_KERNEL); if (!psif) { dev_dbg(&pdev->dev, "out of memory\n"); - ret = -ENOMEM; - goto out; + return -ENOMEM; } psif->pdev = pdev; @@ -297,7 +296,6 @@ out_free_io: kfree(io); out_free_psif: kfree(psif); -out: return ret; }