Re: [PATCHv3 9/9] extcon: palmas: Use devm_extcon_dev_allocate for extcon_dev

From: Felipe Balbi
Date: Thu Apr 24 2014 - 10:47:47 EST


On Thu, Apr 24, 2014 at 09:34:57PM +0900, Chanwoo Choi wrote:
> This patch use devm_extcon_dev_allocate() to simplify the memory control
> of extcon device.
>
> Cc: Graeme Gregory <gg@xxxxxxxxxxxxxxx>
> Cc: Kishon Vijay Abraham I <kishon@xxxxxx>
> Cc: Felipe Balbi <balbi@xxxxxx>
> Cc: Samuel Ortiz <sameo@xxxxxxxxxxxxxxx>
> Cc: Lee Jones <lee.jones@xxxxxxxxxx>
> Signed-off-by: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>
> Acked-by: Lee Jones <lee.jones@xxxxxxxxxx>

Tested-by: Felipe Balbi <balbi@xxxxxx>

*BUT* you need to fix NULL vs ERR_PTR return in your code. The way this
is, we can easily dereference an ERR_PTR because the code doesn't test
for it. I suggest always returning valid pointer or ERR_PTR and avoid
returning NULL at all.

--
balbi

Attachment: signature.asc
Description: Digital signature