Re: Regression in 2.6.21-mm1 (git-input) on Dell D610 laptop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



And Dmitry Torokhov writes:
> I don't think so. Could you please try the patch below? Thanks!

The appended patch on top of yours fixes the too-early access of
psmouse->private.  I don't know the expected lifetime of
psmouse->private, so I chickened out of simply assigning priv
earlier.

BTW, why do you pass psmouse down through the initializations
rather than ps2dev and private?

Jason, using git's index, dammit...

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 2aeb299..990d2a5 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -384,10 +384,9 @@ static int alps_poll(struct psmouse *psmouse)
 	return 0;
 }
 
-static int alps_hw_init(struct psmouse *psmouse, int *version)
+static int alps_hw_init(struct psmouse *psmouse, struct alps_data *priv,
+			int *version)
 {
-	struct alps_data *priv = psmouse->private;
-
 	priv->i = alps_get_model(psmouse, version);
 	if (!priv->i)
 		return -1;
@@ -421,7 +420,7 @@ static int alps_reconnect(struct psmouse *psmouse)
 {
 	psmouse_reset(psmouse);
 
-	if (alps_hw_init(psmouse, NULL))
+	if (alps_hw_init(psmouse, (struct alps_data *)psmouse->private, NULL))
 		return -1;
 
 	return 0;
@@ -449,7 +448,7 @@ int alps_init(struct psmouse *psmouse)
 
 	priv->dev2 = dev2;
 
-	if (alps_hw_init(psmouse, &version))
+	if (alps_hw_init(psmouse, priv, &version))
 		goto init_fail;
 
 	dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux