# Re: \[patch 2/2 -next\] hid-lg4ff: add a kfree() to an error path

- From: Dan Carpenter \<hidden\>
- Date: 2011-08-18 16:27:01 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2011/08/8917529
- Thread: https://ratatoskr.run/linux-input/2011/08/8917529/t.md

```text
On Thu, Aug 18, 2011 at 07:59:32PM +0530, Zic Rim wrote:
> There is no leak here. If kzalloc fails , it means memory is not allocated.
> It is wrong to free something that is not allocated .

No.  The entry allocation succeeded and the entry->device_id
allocation failed.  Look again.

regards,
dan carpenter

```
