Re: [PATCH 1/1] staging: rtl8723bs: make memcmp() calls consistent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 10, 2017 at 08:35:12PM +0100, Nicolas Iooss wrote:
> rtw_pm_set() uses memcmp() with 5-chars strings and a length of 4 when
> parsing extra, and then parses extra+4 as an int:
> 
>     if (!memcmp(extra, "lps =", 4)) {
>         sscanf(extra+4, "%u", &mode);
>     /* ... */
>     } else if (!memcmp(extra, "ips =", 4)) {
>         sscanf(extra+4, "%u", &mode);
> 
> The space between the key ("lps" and "ips") and the equal sign seems
> suspicious. Remove it in order to make the calls to memcmp() consistent.

But you now just changing the parsing logic.  What broke because of
this?  Did you test this codepath with your patch?

I'm not disagreeing that this code seems really odd, but it must be
working as-is for someone, to change this logic will break their system
:(

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux