Re: [PATCH net-next v3 1/2] nfc: llcp_core: Hold a ref to llcp_local->dev when holding a ref to llcp_local

From: Krzysztof Kozlowski
Date: Wed Dec 06 2023 - 03:48:56 EST


On 05/12/2023 19:01, Siddh Raman Pant wrote:
> On Tue, 05 Dec 2023 22:57:28 +0530, Krzysztof Kozlowski wrote:
>>>> Mismatched order with get. Unwinding is always in reversed order. Or
>>>> maybe other order is here on purpose? Then it needs to be explained.
>>>
>>> Yes, local_release() will free local, so local->dev cannot be accessed.
>>> Will add a comment.
>>
>> So the problem is just storing the pointer? That's not really the valid
>> reason.
>
> Oops, my bad. What would be the valid reason? (if any)

Just store the local->dev pointer and use correct order.

Best regards,
Krzysztof