From patchwork Wed Jul 27 09:10:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 1011032 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6R9Jpw0027247 for ; Wed, 27 Jul 2011 09:20:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754320Ab1G0JUG (ORCPT ); Wed, 27 Jul 2011 05:20:06 -0400 Received: from mx1.zhaw.ch ([160.85.104.50]:56034 "EHLO mx1.zhaw.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754318Ab1G0JUF (ORCPT ); Wed, 27 Jul 2011 05:20:05 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 27 Jul 2011 09:20:07 +0000 (UTC) X-Greylist: delayed 555 seconds by postgrey-1.27 at vger.kernel.org; Wed, 27 Jul 2011 05:20:05 EDT Received: from mx1.zhaw.ch (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id C5D774A2; Wed, 27 Jul 2011 11:10:48 +0200 (CEST) Received: from fermion.zhaw.ch (inst-232.101.zhaw.ch [160.85.232.101]) by mx1.zhaw.ch (Postfix) with ESMTP id 3B8F94A0; Wed, 27 Jul 2011 11:10:48 +0200 (CEST) From: Tobias Klauser To: Dmitry Torokhov Cc: linux-input@vger.kernel.org Subject: [PATCH] Input: gpio_keys - Return proper error code Date: Wed, 27 Jul 2011 11:10:47 +0200 Message-Id: <1311757847-23132-1-git-send-email-tklauser@distanz.ch> X-Mailer: git-send-email 1.7.5.4 X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.7.27.85115 X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_600_699 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS ' Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Return -ENOMEM if kzalloc fails in gpio_keys_get_devtree_pdata. Signed-off-by: Tobias Klauser --- drivers/input/keyboard/gpio_keys.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index ce281d1..67df91a 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -483,7 +483,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev, buttons = kzalloc(pdata->nbuttons * (sizeof *buttons), GFP_KERNEL); if (!buttons) - return -ENODEV; + return -ENOMEM; pp = NULL; i = 0;