All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shubhrajyoti <shubhrajyoti@ti.com>
To: linux-input@vger.kernel.org
Cc: axel.lin@gmail.com, Shubhrajyoti D <a0393217@india.ti.com>
Subject: Re: [PATCH] Prevent the NULL dereferencing
Date: Tue, 05 Apr 2011 15:55:38 +0530	[thread overview]
Message-ID: <4D9AEE22.3050602@ti.com> (raw)
In-Reply-To: <1301997495-20876-1-git-send-email-shubhrajyoti@ti.com>

On Tuesday 05 April 2011 03:28 PM, shubhrajyoti@ti.com wrote:
> From: Shubhrajyoti D<a0393217@india.ti.com>
>
>
> Signed-off-by: Shubhrajyoti D<a0393217@india.ti.com>
Axel's patch added changes to prevent NULL access if pdata is NULL 
adding a check for keymap_data.
> ---
>   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;


  reply	other threads:[~2011-04-05 10:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-05  9:58 [PATCH] Prevent the NULL dereferencing shubhrajyoti
2011-04-05 10:25 ` Shubhrajyoti [this message]
2011-04-06 12:47   ` Axel Lin
2011-04-06 22:31     ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D9AEE22.3050602@ti.com \
    --to=shubhrajyoti@ti.com \
    --cc=a0393217@india.ti.com \
    --cc=axel.lin@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.