Re: [PATCH] Input: ALPS - fix memory leak when detection fails

2015-02-28 Thread Pali Rohár
On Saturday 28 February 2015 00:53:57 Dmitry Torokhov wrote:
> This fixes memory leak introduced by commit
> a09221e83e13e09a33109b9b037484eade901cea
> 
> Signed-off-by: Dmitry Torokhov 
> ---
>  drivers/input/mouse/alps.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/mouse/alps.c
> b/drivers/input/mouse/alps.c index d28726a..1bd15eb 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -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";

Acked-by: Pali Rohár 

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH] Input: ALPS - fix memory leak when detection fails

2015-02-28 Thread Pali Rohár
On Saturday 28 February 2015 00:53:57 Dmitry Torokhov wrote:
 This fixes memory leak introduced by commit
 a09221e83e13e09a33109b9b037484eade901cea
 
 Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com
 ---
  drivers/input/mouse/alps.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/input/mouse/alps.c
 b/drivers/input/mouse/alps.c index d28726a..1bd15eb 100644
 --- a/drivers/input/mouse/alps.c
 +++ b/drivers/input/mouse/alps.c
 @@ -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;

Acked-by: Pali Rohár pali.ro...@gmail.com

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.


[PATCH] Input: ALPS - fix memory leak when detection fails

2015-02-27 Thread Dmitry Torokhov
This fixes memory leak introduced by commit
a09221e83e13e09a33109b9b037484eade901cea

Signed-off-by: Dmitry Torokhov 
---
 drivers/input/mouse/alps.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index d28726a..1bd15eb 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -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";
-- 
2.2.0.rc0.207.ga3a616c


-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Input: ALPS - fix memory leak when detection fails

2015-02-27 Thread Dmitry Torokhov
This fixes memory leak introduced by commit
a09221e83e13e09a33109b9b037484eade901cea

Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com
---
 drivers/input/mouse/alps.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index d28726a..1bd15eb 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -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;
-- 
2.2.0.rc0.207.ga3a616c


-- 
Dmitry
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/