From: Andres Salomon Date: Thu, 17 Jan 2008 17:01:51 +0000 (-0500) Subject: Input: psmouse - fix input_dev leak in lifebook driver X-Git-Tag: v2.6.24~45^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=653e91d01fa4d39d2ed06a8c2096fef08b00ee7e;p=linux-2.6-omap-h63xx.git Input: psmouse - fix input_dev leak in lifebook driver The lifebook driver may register a second input device, but it never unregisters it. This fixes that. Signed-off-by: Andres Salomon Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 9ec57d80186..df81b0aaa9f 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c @@ -225,8 +225,13 @@ static void lifebook_set_resolution(struct psmouse *psmouse, unsigned int resolu static void lifebook_disconnect(struct psmouse *psmouse) { + struct lifebook_data *priv = psmouse->private; + psmouse_reset(psmouse); - kfree(psmouse->private); + if (priv) { + input_unregister_device(priv->dev2); + kfree(priv); + } psmouse->private = NULL; }