All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot]  [PATCH] usb gadget: increase envstr size in cb_getvar
@ 2016-09-21  8:43 Nicolas le bayon
  2017-03-03 10:40 ` Nicolas le bayon
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas le bayon @ 2016-09-21  8:43 UTC (permalink / raw)
  To: u-boot

Hi,

I propose you this patch in order to take into account strings larger than
actual size (32). I recently faced to 'fastboot.partition-type:userdata'
(it was in Android context) but this could be the case for other purposes.

I propose to simply double the size. Is it ok for you?

Regards

---
 drivers/usb/gadget/f_fastboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_fastboot.c
b/drivers/usb/gadget/f_fastboot.c
index 2160b1c..84e22e4 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -432,7 +432,7 @@ static void cb_getvar(struct usb_ep *ep, struct
usb_request *req)
  else
  strcpy(response, "FAILValue not set");
  } else {
- char envstr[32];
+ char envstr[64];

  snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);
  s = getenv(envstr);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] usb gadget: increase envstr size in cb_getvar
  2016-09-21  8:43 [U-Boot] [PATCH] usb gadget: increase envstr size in cb_getvar Nicolas le bayon
@ 2017-03-03 10:40 ` Nicolas le bayon
  2017-03-03 12:26   ` Lukasz Majewski
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas le bayon @ 2017-03-03 10:40 UTC (permalink / raw)
  To: u-boot

Hi,

would it be possible to consider this patch please?

Best Regards
Nicolas

2016-09-21 10:43 GMT+02:00 Nicolas le bayon <nlebayon@gmail.com>:

> Hi,
>
> I propose you this patch in order to take into account strings larger than
> actual size (32). I recently faced to 'fastboot.partition-type:userdata'
> (it was in Android context) but this could be the case for other purposes.
>
> I propose to simply double the size. Is it ok for you?
>
> Regards
>
> ---
>  drivers/usb/gadget/f_fastboot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_
> fastboot.c
> index 2160b1c..84e22e4 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -432,7 +432,7 @@ static void cb_getvar(struct usb_ep *ep, struct
> usb_request *req)
>   else
>   strcpy(response, "FAILValue not set");
>   } else {
> - char envstr[32];
> + char envstr[64];
>
>   snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);
>   s = getenv(envstr);
> --
> 1.9.1
>
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] usb gadget: increase envstr size in cb_getvar
  2017-03-03 10:40 ` Nicolas le bayon
@ 2017-03-03 12:26   ` Lukasz Majewski
  2017-03-05  0:54     ` Marek Vasut
  0 siblings, 1 reply; 7+ messages in thread
From: Lukasz Majewski @ 2017-03-03 12:26 UTC (permalink / raw)
  To: u-boot

Hi Nicolas,

+Marek on CC

> Hi,
> 
> would it be possible to consider this patch please?
> 
> Best Regards
> Nicolas
> 
> 2016-09-21 10:43 GMT+02:00 Nicolas le bayon <nlebayon@gmail.com>:
> 
> > Hi,
> >
> > I propose you this patch in order to take into account strings
> > larger than actual size (32). I recently faced to
> > 'fastboot.partition-type:userdata' (it was in Android context) but
> > this could be the case for other purposes.
> >
> > I propose to simply double the size. Is it ok for you?
> >
> > Regards
> >
> > ---
> >  drivers/usb/gadget/f_fastboot.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_
> > fastboot.c
> > index 2160b1c..84e22e4 100644
> > --- a/drivers/usb/gadget/f_fastboot.c
> > +++ b/drivers/usb/gadget/f_fastboot.c
> > @@ -432,7 +432,7 @@ static void cb_getvar(struct usb_ep *ep, struct
> > usb_request *req)
> >   else
> >   strcpy(response, "FAILValue not set");
> >   } else {
> > - char envstr[32];
> > + char envstr[64];
> >
> >   snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);
> >   s = getenv(envstr);
> > --
> > 1.9.1
> >
> >
> >
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/listinfo/u-boot




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] usb gadget: increase envstr size in cb_getvar
  2017-03-03 12:26   ` Lukasz Majewski
@ 2017-03-05  0:54     ` Marek Vasut
  2017-03-10  9:45       ` Nicolas le bayon
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2017-03-05  0:54 UTC (permalink / raw)
  To: u-boot

On 03/03/2017 01:26 PM, Lukasz Majewski wrote:
> Hi Nicolas,
>
> +Marek on CC

Lukasz, this is gadget stuff, so it's up to you to handle it.

>
>> Hi,
>>
>> would it be possible to consider this patch please?
>>
>> Best Regards
>> Nicolas
>>
>> 2016-09-21 10:43 GMT+02:00 Nicolas le bayon <nlebayon@gmail.com>:
>>
>>> Hi,
>>>
>>> I propose you this patch in order to take into account strings
>>> larger than actual size (32). I recently faced to
>>> 'fastboot.partition-type:userdata' (it was in Android context) but
>>> this could be the case for other purposes.
>>>
>>> I propose to simply double the size. Is it ok for you?
>>>
>>> Regards
>>>
>>> ---
>>>  drivers/usb/gadget/f_fastboot.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_
>>> fastboot.c
>>> index 2160b1c..84e22e4 100644
>>> --- a/drivers/usb/gadget/f_fastboot.c
>>> +++ b/drivers/usb/gadget/f_fastboot.c
>>> @@ -432,7 +432,7 @@ static void cb_getvar(struct usb_ep *ep, struct
>>> usb_request *req)
>>>   else
>>>   strcpy(response, "FAILValue not set");
>>>   } else {
>>> - char envstr[32];
>>> + char envstr[64];
>>>
>>>   snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);

What about using asprintf() or somesuch ?

>>>   s = getenv(envstr);
>>> --
>>> 1.9.1
>>>
>>>
>>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> http://lists.denx.de/listinfo/u-boot
>
>
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] usb gadget: increase envstr size in cb_getvar
  2017-03-05  0:54     ` Marek Vasut
@ 2017-03-10  9:45       ` Nicolas le bayon
  2017-03-10  9:58         ` Marek Vasut
  2017-03-10  9:59         ` Marek Vasut
  0 siblings, 2 replies; 7+ messages in thread
From: Nicolas le bayon @ 2017-03-10  9:45 UTC (permalink / raw)
  To: u-boot

2017-03-05 1:54 GMT+01:00 Marek Vasut <marex@denx.de>:

> On 03/03/2017 01:26 PM, Lukasz Majewski wrote:
>
>> Hi Nicolas,
>>
>> +Marek on CC
>>
>
> Lukasz, this is gadget stuff, so it's up to you to handle it.
>
>
>
>> Hi,
>>>
>>> would it be possible to consider this patch please?
>>>
>>> Best Regards
>>> Nicolas
>>>
>>> 2016-09-21 10:43 GMT+02:00 Nicolas le bayon <nlebayon@gmail.com>:
>>>
>>> Hi,
>>>>
>>>> I propose you this patch in order to take into account strings
>>>> larger than actual size (32). I recently faced to
>>>> 'fastboot.partition-type:userdata' (it was in Android context) but
>>>> this could be the case for other purposes.
>>>>
>>>> I propose to simply double the size. Is it ok for you?
>>>>
>>>> Regards
>>>>
>>>> ---
>>>>  drivers/usb/gadget/f_fastboot.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_
>>>> fastboot.c
>>>> index 2160b1c..84e22e4 100644
>>>> --- a/drivers/usb/gadget/f_fastboot.c
>>>> +++ b/drivers/usb/gadget/f_fastboot.c
>>>> @@ -432,7 +432,7 @@ static void cb_getvar(struct usb_ep *ep, struct
>>>> usb_request *req)
>>>>   else
>>>>   strcpy(response, "FAILValue not set");
>>>>   } else {
>>>> - char envstr[32];
>>>> + char envstr[64];
>>>>
>>>>   snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);
>>>>
>>>
> What about using asprintf() or somesuch ?


It would be a nice idea, but the asprintf function is not available
unfortunately.


>
>   s = getenv(envstr);
>>>> --
>>>> 1.9.1
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> http://lists.denx.de/listinfo/u-boot
>>>
>>
>>
>>
>>
>> Best regards,
>>
>> Lukasz Majewski
>>
>> --
>>
>> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
>>
>>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] usb gadget: increase envstr size in cb_getvar
  2017-03-10  9:45       ` Nicolas le bayon
@ 2017-03-10  9:58         ` Marek Vasut
  2017-03-10  9:59         ` Marek Vasut
  1 sibling, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2017-03-10  9:58 UTC (permalink / raw)
  To: u-boot

On 03/10/2017 10:45 AM, Nicolas le bayon wrote:
> 2017-03-05 1:54 GMT+01:00 Marek Vasut <marex@denx.de>:
> 
>> On 03/03/2017 01:26 PM, Lukasz Majewski wrote:
>>
>>> Hi Nicolas,
>>>
>>> +Marek on CC
>>>
>>
>> Lukasz, this is gadget stuff, so it's up to you to handle it.
>>
>>
>>
>>> Hi,
>>>>
>>>> would it be possible to consider this patch please?
>>>>
>>>> Best Regards
>>>> Nicolas
>>>>
>>>> 2016-09-21 10:43 GMT+02:00 Nicolas le bayon <nlebayon@gmail.com>:
>>>>
>>>> Hi,
>>>>>
>>>>> I propose you this patch in order to take into account strings
>>>>> larger than actual size (32). I recently faced to
>>>>> 'fastboot.partition-type:userdata' (it was in Android context) but
>>>>> this could be the case for other purposes.
>>>>>
>>>>> I propose to simply double the size. Is it ok for you?
>>>>>
>>>>> Regards
>>>>>
>>>>> ---
>>>>>  drivers/usb/gadget/f_fastboot.c | 2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_
>>>>> fastboot.c
>>>>> index 2160b1c..84e22e4 100644
>>>>> --- a/drivers/usb/gadget/f_fastboot.c
>>>>> +++ b/drivers/usb/gadget/f_fastboot.c
>>>>> @@ -432,7 +432,7 @@ static void cb_getvar(struct usb_ep *ep, struct
>>>>> usb_request *req)
>>>>>   else
>>>>>   strcpy(response, "FAILValue not set");
>>>>>   } else {
>>>>> - char envstr[32];
>>>>> + char envstr[64];
>>>>>
>>>>>   snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);
>>>>>
>>>>
>> What about using asprintf() or somesuch ?
> 
> 
> It would be a nice idea, but the asprintf function is not available
> unfortunately.

Well, then use malloc + sprintf ...

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] usb gadget: increase envstr size in cb_getvar
  2017-03-10  9:45       ` Nicolas le bayon
  2017-03-10  9:58         ` Marek Vasut
@ 2017-03-10  9:59         ` Marek Vasut
  1 sibling, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2017-03-10  9:59 UTC (permalink / raw)
  To: u-boot

On 03/10/2017 10:45 AM, Nicolas le bayon wrote:
> 2017-03-05 1:54 GMT+01:00 Marek Vasut <marex@denx.de>:
> 
>> On 03/03/2017 01:26 PM, Lukasz Majewski wrote:
>>
>>> Hi Nicolas,
>>>
>>> +Marek on CC
>>>
>>
>> Lukasz, this is gadget stuff, so it's up to you to handle it.
>>
>>
>>
>>> Hi,
>>>>
>>>> would it be possible to consider this patch please?
>>>>
>>>> Best Regards
>>>> Nicolas
>>>>
>>>> 2016-09-21 10:43 GMT+02:00 Nicolas le bayon <nlebayon@gmail.com>:
>>>>
>>>> Hi,
>>>>>
>>>>> I propose you this patch in order to take into account strings
>>>>> larger than actual size (32). I recently faced to
>>>>> 'fastboot.partition-type:userdata' (it was in Android context) but
>>>>> this could be the case for other purposes.
>>>>>
>>>>> I propose to simply double the size. Is it ok for you?
>>>>>
>>>>> Regards
>>>>>
>>>>> ---
>>>>>  drivers/usb/gadget/f_fastboot.c | 2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_
>>>>> fastboot.c
>>>>> index 2160b1c..84e22e4 100644
>>>>> --- a/drivers/usb/gadget/f_fastboot.c
>>>>> +++ b/drivers/usb/gadget/f_fastboot.c
>>>>> @@ -432,7 +432,7 @@ static void cb_getvar(struct usb_ep *ep, struct
>>>>> usb_request *req)
>>>>>   else
>>>>>   strcpy(response, "FAILValue not set");
>>>>>   } else {
>>>>> - char envstr[32];
>>>>> + char envstr[64];
>>>>>
>>>>>   snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);
>>>>>
>>>>
>> What about using asprintf() or somesuch ?
> 
> 
> It would be a nice idea, but the asprintf function is not available
> unfortunately.

Well, then use malloc + snprintf ...

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-10  9:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21  8:43 [U-Boot] [PATCH] usb gadget: increase envstr size in cb_getvar Nicolas le bayon
2017-03-03 10:40 ` Nicolas le bayon
2017-03-03 12:26   ` Lukasz Majewski
2017-03-05  0:54     ` Marek Vasut
2017-03-10  9:45       ` Nicolas le bayon
2017-03-10  9:58         ` Marek Vasut
2017-03-10  9:59         ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.