Re: [PATCH] qmi: sim: implement lock(LockPin method)

Denis Kenzior <[email protected]>
Newsgroups dev.linux.lists.ofono
Message-ID <[email protected]>
Hi Ivo,

<snip>

 >>> +    passwd_len = strlen(passwd);
>>> +
>>> +    if (passwd_len <= 0 || passwd_len > 0xFF)
>>
>> strlen returns a size_t, so checking < 0 doesn't really make sense. Also, the 
>> core already performs validation of the pin using 'is_valid_pin'.  So I'm not 
>> really sure any of this validation is needed?
>>
> 
> I borrowed the code from qmi_pin_send(), shall I create another patch removing 
> the checks there too?

Yeah I think that would be okay.  Generally, the driver should trust that the 
core is performing the needed checks.  The driver should perform any additional 
checks that might be needed specifically for that driver, but these should be rare.

Regards,
-Denis
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.