mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Benoit Boissinot <benoit.boissinot@ens-lyon.org>
Cc: Andrew Morton <akpm@osdl.org>, Greg KH <greg@kroah.com>,
	torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] fix NULL pointer deference in ALPS
Date: Mon, 7 Mar 2005 14:10:02 +0100	[thread overview]
Message-ID: <20050307131002.GA8025@ucw.cz> (raw)
In-Reply-To: <20050307122432.GG8138@ens-lyon.fr>

On Mon, Mar 07, 2005 at 01:24:32PM +0100, Benoit Boissinot wrote:
> I get a NULL pointer deference in with alps while suspending.
> 
> The following patch fixes it: alps_get_model returns a pointer or
> NULL in case of errors, so we need to check for the results being NULL,
> not negative.
> 
> Since it is trivial, it is maybe a candidate for 2.6.11.2.
> 
> It does not apply to -mm since the last occurence of alps_get_model
> was corrected (but not the others), if needed i can send a patch for
> -mm as well.

I already fixed it in my tree, but feel free to push it for the sucker
tree.

> regards,
> 
> Benoit
> 
> Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org>
> 
> 
> --- linux-clean/drivers/input/mouse/alps.c	2005-03-07 12:45:46.000000000 +0100
> +++ linux-vanilla/drivers/input/mouse/alps.c	2005-03-07 12:50:12.000000000 +0100
> @@ -325,7 +325,7 @@ static int alps_reconnect(struct psmouse
>  	int model;
>  	unsigned char param[4];
>  
> -	if ((model = alps_get_model(psmouse)) < 0)
> +	if (!(model = alps_get_model(psmouse)))
>  		return -1;
>  
>  	if (model == ALPS_MODEL_DUALPOINT && alps_passthrough_mode(psmouse, 1))
> @@ -358,7 +358,7 @@ int alps_init(struct psmouse *psmouse)
>  	unsigned char param[4];
>  	int model;
>  
> -	if ((model = alps_get_model(psmouse)) < 0)
> +	if (!(model = alps_get_model(psmouse)))
>  		return -1;
>  
>  	printk(KERN_INFO "ALPS Touchpad (%s) detected\n",
> @@ -412,7 +412,7 @@ int alps_init(struct psmouse *psmouse)
>  
>  int alps_detect(struct psmouse *psmouse, int set_properties)
>  {
> -	if (alps_get_model(psmouse) < 0)
> +	if (!alps_get_model(psmouse))
>  		return -1;
>  
>  	if (set_properties) {
> 
> 

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

  reply	other threads:[~2005-03-07 13:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-07 12:24 Benoit Boissinot
2005-03-07 13:10 ` Vojtech Pavlik [this message]
2005-03-07 13:11   ` Vojtech Pavlik
2005-03-07 14:06 ` Alexey Dobriyan
2005-03-07 13:12   ` Benoit Boissinot

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=20050307131002.GA8025@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=akpm@osdl.org \
    --cc=benoit.boissinot@ens-lyon.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®