diff mbox

Input: gpio_keys - Return proper error code

Message ID 1311757847-23132-1-git-send-email-tklauser@distanz.ch (mailing list archive)
State Accepted
Commit 1f4bb066433322f6f189b084ceebdfb4add77292
Headers show

Commit Message

Tobias Klauser July 27, 2011, 9:10 a.m. UTC
Return -ENOMEM if kzalloc fails in gpio_keys_get_devtree_pdata.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/input/keyboard/gpio_keys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Dmitry Torokhov July 30, 2011, 7:08 p.m. UTC | #1
On Wed, Jul 27, 2011 at 11:10:47AM +0200, Tobias Klauser wrote:
> Return -ENOMEM if kzalloc fails in gpio_keys_get_devtree_pdata.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Applied, thanks Tobias.
diff mbox

Patch

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;