Re: [PATCH] usb: musb_dsps: fix res_name length

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

 



On 17.10.2012 20:47, David Binderman wrote:
>> sprintf(res_name, "port%d-mode", id);
>>
>> Hence, res_name must be at least 11 characters long in order to store
>> the name including the terminating '\0'.
> 
> Your patch seems plausible if the number of instances is 9 or less:
> indeed there currently might only be 2, if I read the source code ok.
> 
> Parameter id is if type u8, you might want to add a few more chars to
> res_name to accommodate possible future expansion up to 256.

As you already said yourself, there can currently be only 2. But you're
right, we should be more careful here, so I'll amend the patch and make
it use snprintf() instead.


Thanks,
Daniel

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux