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

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

 





Hello there,

> 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.

Just an idea, it doesn't have to happen.

Regards

David Binderman

>
> Reported-by: David Binderman <dcb314@xxxxxxxxxxx>
> Signed-off-by: Daniel Mack <zonque@xxxxxxxxx>
> ---
> drivers/usb/musb/musb_dsps.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
> index 444346e..425d893 100644
> --- a/drivers/usb/musb/musb_dsps.c
> +++ b/drivers/usb/musb/musb_dsps.c
> @@ -458,7 +458,7 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
> struct platform_device *musb;
> struct resource *res;
> struct resource resources[2];
> - char res_name[10];
> + char res_name[11];
> int ret, musbid;
>
> /* get memory resource */
> --
> 1.7.11.7
>
 		 	   		  --
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