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

From: Chanwoo Choi
Date: Thu Apr 24 2014 - 11:13:26 EST


On Thu, Apr 24, 2014 at 11:47 PM, Felipe Balbi <balbi@xxxxxx> wrote:
> 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>

Thanks for your test.

>
> *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.

OK, as my reply on other mail, I'll fix return type by using ERR_PTR
instead of NULL.

Thanks,
Chanwoo Choi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/