lkml.org 
[lkml]   [2013]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 6/6] Input: Add ChromeOS EC keyboard driver
Hi Simon,

On Fri, Feb 15, 2013 at 08:16:12PM -0800, Simon Glass wrote:
> + for (row = 0; row < ckdev->rows; row++) {
> + if (cros_ec_keyb_row_has_ghosting(ckdev, buf, row))
> + return true;
> + }

No need for curly braces here. I would not care if not for below.

> +
> + return 0;
> +
> +fail_register:
> + kfree(idev->keycode);

Sorry I did not notice this before, but idev->keycode is devm-managed,
so you either need to use devm_kfree() or just remove call to kfree()
and let it clean up automatically (which will happen if binding fails or
upon removal).

BTW, maybe you should move the whole driver to devm_*? We have
devm_kzalloc() for ckdev and you can use devm_input_allocate_device().
Then you can get rid of entire erro handling path and completely remove
the remove() method as well.

> +fail_matrix:
> + input_free_device(idev);
> +fail_alloc_dev:
> + kfree(ckdev);
> + return err;
> +}
> +

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2013-02-16 22:01    [W:0.094 / U:1.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site