From patchwork Tue Apr 5 09:58:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 686411 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p359wRTL030438 for ; Tue, 5 Apr 2011 09:58:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751563Ab1DEJ6X (ORCPT ); Tue, 5 Apr 2011 05:58:23 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:35473 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750920Ab1DEJ6X (ORCPT ); Tue, 5 Apr 2011 05:58:23 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p359wJAg032416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Apr 2011 04:58:22 -0500 Received: from a0393217ubnlt.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p359wH9M025192; Tue, 5 Apr 2011 15:28:18 +0530 (IST) From: shubhrajyoti@ti.com To: linux-input@vger.kernel.org Cc: axel.lin@gmail.com, Shubhrajyoti D Subject: [PATCH] Prevent the NULL dereferencing Date: Tue, 5 Apr 2011 15:28:15 +0530 Message-Id: <1301997495-20876-1-git-send-email-shubhrajyoti@ti.com> X-Mailer: git-send-email 1.7.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 05 Apr 2011 09:58:27 +0000 (UTC) From: Shubhrajyoti D Signed-off-by: Shubhrajyoti D Acked-by: Axel Lin --- drivers/input/keyboard/twl4030_keypad.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index 09bef79..cc06c4b 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c @@ -338,7 +338,7 @@ static int __devinit twl4030_kp_probe(struct platform_device *pdev) u8 reg; int error; - if (!pdata || !pdata->rows || !pdata->cols || + if (!pdata || !pdata->rows || !pdata->cols || !pdata->keymap_data || pdata->rows > TWL4030_MAX_ROWS || pdata->cols > TWL4030_MAX_COLS) { dev_err(&pdev->dev, "Invalid platform_data\n"); return -EINVAL;