From patchwork Wed Jan 24 20:31:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10183065 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 0526860233 for ; Wed, 24 Jan 2018 20:31:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6BBC28942 for ; Wed, 24 Jan 2018 20:31:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAC1327CF9; Wed, 24 Jan 2018 20:31:15 +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 6402027CF9 for ; Wed, 24 Jan 2018 20:31:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932155AbeAXUbO (ORCPT ); Wed, 24 Jan 2018 15:31:14 -0500 Received: from mout.web.de ([212.227.15.14]:53359 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbeAXUbN (ORCPT ); Wed, 24 Jan 2018 15:31:13 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Mf0a9-1ePGER1hiD-00OWL6; Wed, 24 Jan 2018 21:31:10 +0100 Subject: [PATCH 2/3] Input: bcm5974: Return directly after a failed kmalloc() in bcm5974_wellspring_mode() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov , Henrik Rydberg Cc: LKML , kernel-janitors@vger.kernel.org References: <0505482c-287f-8809-76e3-960cf45b3c0a@users.sourceforge.net> Message-ID: <8befb181-9f0e-84f4-9080-4bde3d666a3b@users.sourceforge.net> Date: Wed, 24 Jan 2018 21:31:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <0505482c-287f-8809-76e3-960cf45b3c0a@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:+BKLtoNbSWWQG13ec9Sr1xgltVj50C8FKyQ7xysy/m6LabVi8Tc tL2t++jPjSJ548XfbJ+YTlXMzClWV8FQivu5CWL0HK0OhVGD2Il5ilLdMtj4RdBRdRVGA3a p9/8JsOAM2h1BCgC4RVpZ4awwYPdwqNEAj4Hp+V6clKaee6eXQAbMd811PL0MSpu2gI/QOV 3tW7k/SLG+zweMC7pts/Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:Zj6uKw2b1YI=:/Ak0XqZNF5Ucc3Ah8fLs2L dn+eBbS6TiV9PK+PgKSctsQpskb77YS9MYR0hlSi5+fOqktf5In7WYnKahdXSJ3URkzmgLkdH 6bE/3LgvtMy/4SwRSUOGQlvmrebNYh6n73XL9aT5TSW4QI5m/uIG9T1Jc3NTQwF9itAIlYX41 +f6utaQwM7IOigYg8AL/K2bq1ZzmRWtQjXKUjodLJ+PmIYWwUWy5uu7qqiGhviSpi0SqMMzVn puLdVohF3dik8dC/GqQy3qXWEGANCpLY8YDL41RrrltoOKbyYYAazawSuHBwgxzK/CF8Ag3KF +ZHXGvCL5Rk9neI4gIQ/xlig5yTealy5+4mNNYk5OrCdOpO6o+sk/W3h0a7qpzWriIE76DVeu FN0c0wdx7U8CPmevEvSblzl+3AlQsc2mxD/s4daLJg7uINFzPGovN8/kg3gbPOLD31xdCTiWf RDwI+kfaSemKN30i3cehEzkz7wQtV6cXCNdQpJ+SIsYAJHZyYH8cmjZ/mvkHSrzpCl+G9jGXR 5p7Q6ihmwxQ0lZD3IC6tXxIdQtS/OR4JT4Zl+S2rOIw5ogkwZ1QgZR5IiR4wyZQ4Miuso2Po4 QxLoMer5EXJ1bEfedFC4KQ20SBhq9yWuENKH0WqKMIVLFtJTfWtMOwWDiSBsCZzFh17AntKwD lzAhSHviQj9DgIA+pnmoIVOuGnIXkeBtt33a6GG7Wl5o+eqOAdOoBJdmLW+i3aDhoqUAZE4yb SbbWKZIgh99ylv7FyFF1uMeiLkJigZiUOC4z1aUJ1HUyYd6qbvEmLXRCG/gCrLWSulcMoAPiM TSzk+7ezMOoNkAOrIOnAJywkSQ1fZGJ2lRgz6DDqdbaO8eJfc8= 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: Wed, 24 Jan 2018 21:14:51 +0100 Return directly after a call of the function "kmalloc" failed at the beginning. Signed-off-by: Markus Elfring --- drivers/input/mouse/bcm5974.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 994805513df9..685f56c08931 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -669,10 +669,8 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) return 0; data = kmalloc(c->um_size, GFP_KERNEL); - if (!data) { - retval = -ENOMEM; - goto out; - } + if (!data) + return -ENOMEM; /* read configuration */ size = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),