On Wed, 12 Apr 2017, Felipe Balbi wrote:
> >> Maybe... But I can't shake the feeling that Greg KH would strongly
> >> disagree. Hasn't he said, many times in the past, that any dynamically
> >> allocated device structure _must_ have a real release routine?
> >> usb_udc_nop_release() doesn't
Hi,
Greg KH writes:
>> Here's what we have for most UDCs (net2280.c included):
>>
>> struct my_udc {
>> struct gadget gadget;
>> [...]
>> };
>>
>> probe()
>> {
>> struct my_udc *u;
>>
>> u = kzalloc(sizeof(*u), GFP_
On Wed, Apr 12, 2017 at 09:01:44AM +0300, Felipe Balbi wrote:
>
> Hi,
>
> Greg KH writes:
> > On Tue, Apr 11, 2017 at 10:12:01AM -0400, Alan Stern wrote:
> >> On Tue, 11 Apr 2017, Felipe Balbi wrote:
> >>
> >> > > Oddly enough, yes. But it doesn't explain why this code doesn't blow
> >> > > u
Hi,
Greg KH writes:
> On Tue, Apr 11, 2017 at 10:12:01AM -0400, Alan Stern wrote:
>> On Tue, 11 Apr 2017, Felipe Balbi wrote:
>>
>> > > Oddly enough, yes. But it doesn't explain why this code doesn't blow
>> > > up every time it gets called, in its current form.
>> >
>> > Well, it does :-)
>
On Tue, Apr 11, 2017 at 10:12:01AM -0400, Alan Stern wrote:
> On Tue, 11 Apr 2017, Felipe Balbi wrote:
>
> > > Oddly enough, yes. But it doesn't explain why this code doesn't blow
> > > up every time it gets called, in its current form.
> >
> > Well, it does :-)
> >
> > dev_get_drvdata(_dev) -
On Tue, 11 Apr 2017, Felipe Balbi wrote:
> > Oddly enough, yes. But it doesn't explain why this code doesn't blow
> > up every time it gets called, in its current form.
>
> Well, it does :-)
>
> dev_get_drvdata(_dev) -> NULL -> kfree(NULL)
>
> We're just leaking memory. I guess a patch like b
Hi,
Alan Stern writes:
>> >> >> >> --- a/drivers/usb/gadget/udc/core.c
>> >> >> >> +++ b/drivers/usb/gadget/udc/core.c
>> >> >> >> @@ -1273,6 +1273,7 @@ void usb_del_gadget_udc(struct usb_gadget
>> >> >> >> *gadget)
>> >> >> >> flush_work(&gadget->work);
>> >> >> >> device_unregister(&u
On Mon, 10 Apr 2017, Felipe Balbi wrote:
> Hi,
>
> Alan Stern writes:
> > On Wed, 5 Apr 2017, Felipe Balbi wrote:
> >
> >> >> >> --- a/drivers/usb/gadget/udc/core.c
> >> >> >> +++ b/drivers/usb/gadget/udc/core.c
> >> >> >> @@ -1273,6 +1273,7 @@ void usb_del_gadget_udc(struct usb_gadget
> >> >>
Hi,
Alan Stern writes:
> On Wed, 5 Apr 2017, Felipe Balbi wrote:
>
>> >> >> --- a/drivers/usb/gadget/udc/core.c
>> >> >> +++ b/drivers/usb/gadget/udc/core.c
>> >> >> @@ -1273,6 +1273,7 @@ void usb_del_gadget_udc(struct usb_gadget
>> >> >> *gadget)
>> >> >>flush_work(&gadget->work);
>> >
On Wed, 5 Apr 2017, Felipe Balbi wrote:
> >> >> --- a/drivers/usb/gadget/udc/core.c
> >> >> +++ b/drivers/usb/gadget/udc/core.c
> >> >> @@ -1273,6 +1273,7 @@ void usb_del_gadget_udc(struct usb_gadget *gadget)
> >> >> flush_work(&gadget->work);
> >> >> device_unregister(&udc->dev);
Hi,
Alan Stern writes:
>> >> allow usb_del_gadget_udc() and usb add_gadget_udc() to be called
>> >> repeatedly on the same gadget->dev structure.
>> >>
>> >> We need to clear the gadget->dev structure so that kobject_init()
>> >> doesn't complain about already initialized object.
>> >>
>> >> S
On Tue, 4 Apr 2017, Felipe Balbi wrote:
> Hi,
>
> Alan Stern writes:
> > On Mon, 3 Apr 2017, Roger Quadros wrote:
> >
> >> allow usb_del_gadget_udc() and usb add_gadget_udc() to be called
> >> repeatedly on the same gadget->dev structure.
> >>
> >> We need to clear the gadget->dev structure so
Hi,
Alan Stern writes:
> On Mon, 3 Apr 2017, Roger Quadros wrote:
>
>> allow usb_del_gadget_udc() and usb add_gadget_udc() to be called
>> repeatedly on the same gadget->dev structure.
>>
>> We need to clear the gadget->dev structure so that kobject_init()
>> doesn't complain about already init
On Mon, 3 Apr 2017, Roger Quadros wrote:
> allow usb_del_gadget_udc() and usb add_gadget_udc() to be called
> repeatedly on the same gadget->dev structure.
>
> We need to clear the gadget->dev structure so that kobject_init()
> doesn't complain about already initialized object.
>
> Signed-off-by
allow usb_del_gadget_udc() and usb add_gadget_udc() to be called
repeatedly on the same gadget->dev structure.
We need to clear the gadget->dev structure so that kobject_init()
doesn't complain about already initialized object.
Signed-off-by: Roger Quadros
---
drivers/usb/gadget/udc/core.c | 1
15 matches
Mail list logo