Re: [PATCH 13/14] HID: i2c-hid: also call i2c_hid_free_buffers in i2c_hid_remove

2012-12-05 Thread Jean Delvare
On Tue,  4 Dec 2012 16:27:54 +0100, Benjamin Tissoires wrote:
> In the case where the hid driver in charge of handling the hid part
> of the device (hid-generic for instance) fails at probe, neither
> i2c_hid_start nor i2c_hid_stop are called.
> Thus, the buffers allocated in i2c_hid_probe are never freed.
> 
> Signed-off-by: Benjamin Tissoires 
> ---
>  drivers/hid/i2c-hid/i2c-hid.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index bea4b13..62988f1 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -891,6 +891,9 @@ static int __devexit i2c_hid_remove(struct i2c_client 
> *client)
>  
>   free_irq(client->irq, ihid);
>  
> + if (ihid->bufsize)
> + i2c_hid_free_buffers(ihid);
> +
>   kfree(ihid);
>  
>   return 0;

Reviewed-by: Jean Delvare 

-- 
Jean Delvare
--
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/


Re: [PATCH 13/14] HID: i2c-hid: also call i2c_hid_free_buffers in i2c_hid_remove

2012-12-05 Thread Jiri Kosina
On Tue, 4 Dec 2012, Benjamin Tissoires wrote:

> In the case where the hid driver in charge of handling the hid part
> of the device (hid-generic for instance) fails at probe, neither
> i2c_hid_start nor i2c_hid_stop are called.
> Thus, the buffers allocated in i2c_hid_probe are never freed.
> 
> Signed-off-by: Benjamin Tissoires 
> ---
>  drivers/hid/i2c-hid/i2c-hid.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index bea4b13..62988f1 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -891,6 +891,9 @@ static int __devexit i2c_hid_remove(struct i2c_client 
> *client)
>  
>   free_irq(client->irq, ihid);
>  
> + if (ihid->bufsize)
> + i2c_hid_free_buffers(ihid);
> +
>   kfree(ihid);

Applied.

-- 
Jiri Kosina
SUSE Labs
--
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/


Re: [PATCH 13/14] HID: i2c-hid: also call i2c_hid_free_buffers in i2c_hid_remove

2012-12-05 Thread Jiri Kosina
On Tue, 4 Dec 2012, Benjamin Tissoires wrote:

 In the case where the hid driver in charge of handling the hid part
 of the device (hid-generic for instance) fails at probe, neither
 i2c_hid_start nor i2c_hid_stop are called.
 Thus, the buffers allocated in i2c_hid_probe are never freed.
 
 Signed-off-by: Benjamin Tissoires benjamin.tissoi...@gmail.com
 ---
  drivers/hid/i2c-hid/i2c-hid.c | 3 +++
  1 file changed, 3 insertions(+)
 
 diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
 index bea4b13..62988f1 100644
 --- a/drivers/hid/i2c-hid/i2c-hid.c
 +++ b/drivers/hid/i2c-hid/i2c-hid.c
 @@ -891,6 +891,9 @@ static int __devexit i2c_hid_remove(struct i2c_client 
 *client)
  
   free_irq(client-irq, ihid);
  
 + if (ihid-bufsize)
 + i2c_hid_free_buffers(ihid);
 +
   kfree(ihid);

Applied.

-- 
Jiri Kosina
SUSE Labs
--
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/


Re: [PATCH 13/14] HID: i2c-hid: also call i2c_hid_free_buffers in i2c_hid_remove

2012-12-05 Thread Jean Delvare
On Tue,  4 Dec 2012 16:27:54 +0100, Benjamin Tissoires wrote:
 In the case where the hid driver in charge of handling the hid part
 of the device (hid-generic for instance) fails at probe, neither
 i2c_hid_start nor i2c_hid_stop are called.
 Thus, the buffers allocated in i2c_hid_probe are never freed.
 
 Signed-off-by: Benjamin Tissoires benjamin.tissoi...@gmail.com
 ---
  drivers/hid/i2c-hid/i2c-hid.c | 3 +++
  1 file changed, 3 insertions(+)
 
 diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
 index bea4b13..62988f1 100644
 --- a/drivers/hid/i2c-hid/i2c-hid.c
 +++ b/drivers/hid/i2c-hid/i2c-hid.c
 @@ -891,6 +891,9 @@ static int __devexit i2c_hid_remove(struct i2c_client 
 *client)
  
   free_irq(client-irq, ihid);
  
 + if (ihid-bufsize)
 + i2c_hid_free_buffers(ihid);
 +
   kfree(ihid);
  
   return 0;

Reviewed-by: Jean Delvare kh...@linux-fr.org

-- 
Jean Delvare
--
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/