'cdev->os_desc_req' has been allocated with 'usb_ep_alloc_request()' so
'usb_ep_free_request()' should be used to free it.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/composite.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a
WARNING: sizes look different: '%s' vs '%s'" % (y0, y1)
Fixes: 2abd9d5fa60f9 ("usb: dwc3: ep0: Add chained TRB support")
Signed-off-by: Christophe JAILLET
---
Untested
---
drivers/usb/dwc3/gadget.c | 4 ++--
1 file changed, 2 insert
In 'composite_os_desc_req_prepare', if one of the memory allocations fail,
0 will be returned, which means success.
We should return -ENOMEM instead.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/composite.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
di
'cdev->os_desc_req' has been allocated with 'usb_ep_alloc_request' so
'usb_ep_free_request' should be used to free it.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/composite.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a
'cdev->os_desc_req' has been allocated with 'usb_ep_alloc_request' so
'usb_ep_free_request' should be used to free it.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/composite.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a
If this memory allocation fail, we will return 0, which means success.
Return -ENOMEM instead.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/function/uvc_configfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/uvc_configfs.c
b
Apologies,
this one has been sent by error.
It is the same as:
[PATCH 2/2] usb: gadget: composite: Fix function used to free memory
sent a couple of minutes before.
Best regards,
CJ
Le 16/07/2016 à 08:57, Christophe JAILLET a écrit :
'cdev->os_desc_req' has been a
'kbuf' is allocated just a few lines above using 'memdup_user()'.
If the 'if (dev->buf)' test fails, this memory is never released.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/legacy/inode.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Christophe JAILLET (2):
usb: xhci: dbc: Simplify error handling in 'xhci_dbc_alloc_requests()'
usb: xhci: dbc: Use GFP_KERNEL instead of GFP_ATOMIC in
'xhci_dbc_alloc_requests()'
drivers/usb/host/xhci-dbgtty.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.20.1
There is no need to use GFP_ATOMIC to allocate 'req'. GFP_KERNEL should be
enough and is already used for another allocation juste a few lines below.
Signed-off-by: Christophe JAILLET
---
I've done my best to check if a spinlock can be hold when reaching this
code. Apparently
oid xhci_dbc_free_req(struct dbc_ep *dep, struct dbc_request *req)
{
kfree(req->buf);
dbc_free_request(dep, req);
}
and 'req->buf' is known to be NULL at this point
Signed-off-by: Christophe JAILLET
---
drivers/usb/host/xhci-dbgtty.c | 2 +-
1 file changed, 1 inserti
There is no need to use GFP_ATOMIC when calling 'usb_alloc_coherent()'
here. These calls are done from probe functions and using GFP_KERNEL should
be safe.
The memory itself is used within some interrupts, but it is not a
problem, once it has been allocated.
Signed-off-by: Christop
Hi, (and sorry if you receive this email twice. I've used a web mail
which sends HTML by default and it was rejected by ML)
Le 01/08/2019 à 12:06, walter harms a écrit :
Am 01.08.2019 09:47, schrieb Christophe JAILLET:
There is no need to use GFP_ATOMIC when calling 'usb_allo
evm_ function to simplify code.
I've left the request_irq/free_irq because I'm unsure of potential side
effects if some other resources are freed while an IRQ can still be
triggered. So I've preferred to leave it as-is.
Christophe JAILLET (4):
usb: gadget: fotg210-udc: Remove a us
pportunity to further simplify code.
(In fact, this change should be a no-op, because 'req' is the first field of
'struct fotg210_request'. So passing NULL would result in 'free(NULL)' in
'fotg210_ep_free_request()'. Anyway avoiding the goto is cleaner.)
Use 'devm_kzalloc()' and 'devm_ioremap()' to simplify code.
While at it, turn some '== NULL' into shorter '!' when testing memory
allocation failure.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/udc/fotg210-udc.c | 25 --
The memory referenced by the 'fotg210->ep[]' array, is never freed.
So there is a memory leak in the error handling path of the probe function
and when the driver is unloaded.
Use 'devm_kzalloc()' to fix these leaks.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadge
There is no need to use an intermediate array for these memory allocations,
so, axe it.
While at it, turn a '== NULL' into a shorter '!' when testing memory
allocation failure.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/udc/fotg210-udc.c | 6 ++
1 file c
Check memory allocation failure and return -ENOMEM in such a case, as
already done few lines below for another memory allocation.
Signed-off-by: Christophe JAILLET
---
drivers/usb/chipidea/ci_hdrc_usb2.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/chipidea/ci_hdrc_usb2.c
19 matches
Mail list logo