Skip to content

Commit

Permalink
Input: ALPS - fix memory leak when detection fails
Browse files Browse the repository at this point in the history
This fixes memory leak introduced by commit
a09221e

Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Dmitry Torokhov committed Mar 4, 2015
1 parent 4a6155a commit 93050db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/mouse/alps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2605,8 +2605,10 @@ int alps_detect(struct psmouse *psmouse, bool set_properties)
return -ENOMEM;

error = alps_identify(psmouse, priv);
if (error)
if (error) {
kfree(priv);
return error;
}

if (set_properties) {
psmouse->vendor = "ALPS";
Expand Down

0 comments on commit 93050db

Please sign in to comment.