Re: [PATCH] nfc: pn533: Add poll mod list filling check

From: Krzysztof Kozlowski
Date: Thu Jul 04 2024 - 08:08:02 EST


On 03/07/2024 09:26, Aleksandr Mishin wrote:
>
>
> On 03.07.2024 8:02, Krzysztof Kozlowski wrote:
>> On 02/07/2024 11:39, Aleksandr Mishin wrote:
>>> In case of im_protocols value is 1 and tm_protocols value is 0 this
>>
>> Which im protocol has value 1 in the mask?
>>
>> The pn533_poll_create_mod_list() handles all possible masks, so your
>> case is just not possible to happen.
>
> Exactly. pn533_poll_create_mod_list() handles all possible specified
> masks. No im protocol has value 1 in the mask. In case of 'im_protocol'

Which cannot happen.

> parameter has value of 1, no mod will be added. So dev->poll_mod_count
> will remain 0.

Which cannot happen.

> I assume 'im_protocol' parameter is "external" to this driver, it comes
> from outside and can contain any value, so driver has to be able to
> protect itself from incorrect values.

Did you read what I wrote? It cannot happen.

Best regards,
Krzysztof