diff mbox

[02/15] Input: synaptics-rmi4 - don't kfree devm_ alloced memory

Message ID 1390521623-6491-3-git-send-email-courtney.cavin@sonymobile.com (mailing list archive)
State New, archived
Headers show

Commit Message

Courtney Cavin Jan. 24, 2014, midnight UTC
Cc: Christopher Heiny <cheiny@synaptics.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
---
 drivers/input/rmi4/rmi_f01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christopher Heiny Feb. 4, 2014, 11:08 p.m. UTC | #1
On 01/23/2014 04:00 PM, Courtney Cavin wrote:
> Cc: Christopher Heiny <cheiny@synaptics.com>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>

This is redundant with patch code submitted 2013/01/22.  See here:
     http://www.spinics.net/lists/linux-input/msg29280.html

and in any case, Dmitry has submitted a more thorough tidy up here:
     http://www.spinics.net/lists/linux-input/msg29323.html

> ---
>   drivers/input/rmi4/rmi_f01.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c
> index cf1081f..98bc65a9 100644
> --- a/drivers/input/rmi4/rmi_f01.c
> +++ b/drivers/input/rmi4/rmi_f01.c
> @@ -390,7 +390,7 @@ static int rmi_f01_initialize(struct rmi_function *fn)
>   	return 0;
>
>    error_exit:
> -	kfree(data);
> +	devm_kfree(&fn->dev, data);
>   	return error;
>   }
>
>
Courtney Cavin Feb. 5, 2014, 2:27 a.m. UTC | #2
On Wed, Feb 05, 2014 at 12:08:19AM +0100, Christopher Heiny wrote:
> On 01/23/2014 04:00 PM, Courtney Cavin wrote:
> > Cc: Christopher Heiny <cheiny@synaptics.com>
> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
> 
> This is redundant with patch code submitted 2013/01/22.  See here:
>      http://www.spinics.net/lists/linux-input/msg29280.html
> 
> and in any case, Dmitry has submitted a more thorough tidy up here:
>      http://www.spinics.net/lists/linux-input/msg29323.html
> 

Neither of these two patches resolve the issue here, which is that you
should not directly free the memory allocated by devm_kzalloc() in
rmi_f01_alloc_memory().

> > ---
> >   drivers/input/rmi4/rmi_f01.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c
> > index cf1081f..98bc65a9 100644
> > --- a/drivers/input/rmi4/rmi_f01.c
> > +++ b/drivers/input/rmi4/rmi_f01.c
> > @@ -390,7 +390,7 @@ static int rmi_f01_initialize(struct rmi_function *fn)
> >   	return 0;
> >
> >    error_exit:
> > -	kfree(data);
> > +	devm_kfree(&fn->dev, data);
> >   	return error;
> >   }
> >
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c
index cf1081f..98bc65a9 100644
--- a/drivers/input/rmi4/rmi_f01.c
+++ b/drivers/input/rmi4/rmi_f01.c
@@ -390,7 +390,7 @@  static int rmi_f01_initialize(struct rmi_function *fn)
 	return 0;
 
  error_exit:
-	kfree(data);
+	devm_kfree(&fn->dev, data);
 	return error;
 }