The device_get_named_child_node() function doesn't return error
pointers, it returns NULL on error.
Fixes: 1c48c759ef4b ("usb: typec: driver for TI HD3SS3220 USB Type-C DRP port
controller")
Signed-off-by: Dan Carpenter
---
v2: remove -ENODEV instead of -EIO
drivers/usb/typec/
The problem is that sizeof() is unsigned long so negative error codes
are type promoted to high positive values and the condition becomes
false.
Fixes: 1d427be4a39d ("USB: legousbtower: fix slab info leak at probe")
Signed-off-by: Dan Carpenter
---
v2: style improvement suggested by Wa
On Fri, Oct 11, 2019 at 03:51:26PM +0200, walter harms wrote:
>
>
> Am 11.10.2019 15:35, schrieb Dan Carpenter:
> > The problem is that sizeof() is unsigned long so negative error codes
> > are type promoted to high positive values and the condition becomes
>
The device_get_named_child_node() function doesn't return error
pointers, it returns NULL on error.
Fixes: 1c48c759ef4b ("usb: typec: driver for TI HD3SS3220 USB Type-C DRP port
controller")
Signed-off-by: Dan Carpenter
---
drivers/usb/typec/hd3ss3220.c | 4 ++--
1 file change
The problem is that sizeof() is unsigned long so negative error codes
are type promoted to high positive values and the condition becomes
false.
Fixes: 1d427be4a39d ("USB: legousbtower: fix slab info leak at probe")
Signed-off-by: Dan Carpenter
---
drivers/usb/misc/legousbtower.c | 2
operty_read_bool(np, "usb-role-switch"))
438 data->usbmisc_data->ext_id = 1;
^^
439
440 if (!IS_ERR(pdata.vbus_extcon.edev) ||
441 of_property_read_bool(np, "usb-role-switch"))
442 data->usbmisc_data->ext_vbus = 1;
These should probably check for NULL? This driver seems to check pretty
consistently.
443
444 ret = imx_usbmisc_init_post(data->usbmisc_data);
regards,
dan carpenter
The "port->typec_caps.data" and "port->typec_caps.type" variables are
enums and in this context GCC will treat them as an unsigned int so they
can never be less than zero.
Fixes: ae8a2ca8a221 ("usb: typec: Group all TCPCI/TCPM code together")
Signed-off-by:
default:
341 ret = -EINVAL;
342 }
343 break;
344 default:
345 ret = -EINVAL;
346 }
regards,
dan carpenter
We can't use "wrap" after it has been freed.
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Signed-off-by: Dan Carpenter
---
drivers/usb/cdns3/cdns3-pci-wrap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/cdns3/cd
The code is supposed to clear the RH_A_NPS and RH_A_PSM bits, but it's
a no-op because of the & vs | typo. This bug predates git and it was
only discovered using static analysis so it must not affect too many
people in real life.
Signed-off-by: Dan Carpenter
Acked-by: Alan Stern
---
I was looking at this code again today and I'm still convinced this
patch is correct. Should I resend?
regards,
dan carpenter
On Fri, Feb 23, 2018 at 03:33:00PM +0300, Dan Carpenter wrote:
> The code is supposed to clear the RH_A_NPS and RH_A_PSM bits, but it's
> a no-op bec
On Mon, Jun 24, 2019 at 03:41:54PM +0200, mirq-li...@rere.qmqm.pl wrote:
> On Mon, Jun 24, 2019 at 03:32:58PM +0300, Dan Carpenter wrote:
> > Hello Michał Mirosław,
> >
> > This is a semi-automatic email about new static checker warnings.
> >
> > The patch 8b4
ty_throttled(tty))
^^^
in the original code there was check for NULL here but the patch removed
it.
439 schedule_delayed_work(&port->push, 1);
440
regards,
dan carpenter
>type) {
2997 case USB_EXT_PROP_UNICODE:
2998 case USB_EXT_PROP_UNICODE_ENV:
2999 case USB_EXT_PROP_UNICODE_LINK:
3000 case USB_EXT_PROP_UNICODE_MULTI:
3001 ext_prop->data_len *= 2;
3002 break;
3003 }
3004 ext_prop->data = ext_prop_data;
regards,
dan carpenter
The devm_memremap() function doesn't return NULL, it returns error
pointers.
Fixes: b0310c2f09bb ("USB: use genalloc for USB HCs with local memory")
Signed-off-by: Dan Carpenter
---
drivers/usb/core/hcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/d
There is an extra space character before the return statement.
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c
index 97b09a42a10c..f3230bed18af 100644
--- a/drivers/usb/usbip/stub_rx.c
+++ b/drivers/usb/usbip/stub_rx.c
@@ -17,9 +17,9 @@ static
PTR_ERR(data->pinctrl));
326 return PTR_ERR(data->pinctrl);
327 }
regards,
dan carpenter
7;t affect runtime.
Signed-off-by: Dan Carpenter
---
drivers/usb/gadget/function/f_sourcesink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_sourcesink.c
b/drivers/usb/gadget/function/f_sourcesink.c
index 9cdef108fb1b..ed68a4860b7d 100644
--- a/d
t could easily be corrupted because multiple
thread log stuff.
So I don't really want to remove the checks because they do narrow the
window where a race would have to occur before we would get memory
corruption. But ideally we would just fix the race.
regards,
dan carpenter
-work patch. Can I use your idea with
> dwc2_hsotg_ep_disable_lock() function to prepare new one?
>
Sparse lock checking is pretty crap, and I wouldn't go out of my way
normally to make it happy... But of course you can use my idea.
regards,
dan carpenter
On Wed, Dec 05, 2018 at 12:52:22PM +, Minas Harutyunyan wrote:
> Hi,
>
> On 12/4/2018 5:29 PM, Dan Carpenter wrote:
> > On Tue, Dec 04, 2018 at 12:34:08PM +, Minas Harutyunyan wrote:
> >> @@ -3185,12 +3183,13 @@ void dwc2_hsotg_disconnect(struct
ex) : DOEPCTL(index);
>
> - locked = spin_is_locked(&hsotg->lock);
> - if (!locked)
> - spin_lock_irqsave(&hsotg->lock, flags);
> + spin_lock_irqsave(&hsotg->lock, flags);
>
One of the callers is already holding the hsotg->log. The
spin_is_locked() test would avoid the deadlock.
regards,
dan carpenter
gain inside dwc2_hsotg_ep_disable().
I don't know the code very well and can't totally swear that this
doesn't introduce a small race condition...
Another option would be to introduce a new function which takes the lock
and change all the other callers instead. To me that would be
Ugh... We also had a long thread about the v2 patch but it turns out
the list was not CC'd. I should have checked for that.
You have to pass a flag to say if the caller holds the lock or not...
regards,
dan carpenter
Smatch complains that "reg" can be uninitialized if the
abx500_get_register_interruptible() call fails. It's an interruptable
function, so we should check if the user presses CTRL-C.
Signed-off-by: Dan Carpenter
---
drivers/usb/phy/phy-ab8500-usb.c | 8 ++--
1 file change
We added some error handling to this function but forgot to set the
error code on this path.
Fixes: ecd29dabb2ba ("usb: dwc2: pci: Handle error cleanup in probe")
Signed-off-by: Dan Carpenter
---
drivers/usb/dwc2/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/dw
e do.
> Commit 9aa8dae7b1fa ("cypress_m8: use usb_fill_int_urb where
> appropriate") incorrectly started setting the transfer length to the
> size of the buffer.
>
This is like the third time recently where we've had found a real bug.
YueHaibing, could you mention in the commit message where the variable
became unused? It would help reviewing. It's not a Fixes tag but it
would look like this:
"After commit 9aa8dae7b1fa ("cypress_m8: use usb_fill_int_urb where
appropriate") then we don't use actual_size any more so that can
be removed."
regards,
dan carpenter
I think we need a check to make sure that "hc_header.wLength" is large
enough for a struct struct uac3_cluster_header_descriptor.
Fixes: 9a2fe9b801f5 ("ALSA: usb: initial USB Audio Device Class 3.0 support")
Signed-off-by: Dan Carpenter
diff --git a/sound/usb/stream.c b/soun
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
usb-testing
head: ae8a2ca8a2215c7e31e6d874f7303801bb15fbbc
commit: cbe743f1333b23040d1312afd58224dbd58fcc25 [34/67] usb: usbtmc: Fix ioctl
USBTMC_IOCTL_ABORT_BULK_IN
New smatch warnings:
drivers/usb/class/usbtmc.c:339 usbtm
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
usb-testing
head: ae8a2ca8a2215c7e31e6d874f7303801bb15fbbc
commit: 658f24f4523e41cda6a389c38b763f4c0cad6fbc [21/67] usb: usbtmc: Add ioctl
for generic requests on control
smatch warnings:
drivers/usb/class/usbtmc.c:1275 usb
On Thu, Sep 20, 2018 at 10:21:26AM +, Minas Harutyunyan wrote:
> Hi Dan,
>
> On 9/20/2018 1:49 PM, Dan Carpenter wrote:
> > is is obviously deliberate that we drop the other thread's lock and
> > then take it ourselves. But I don't think that can be right at al
Hi Minas,
url:
https://github.com/0day-ci/linux/commits/Minas-Harutyunyan/usb-dwc2-Disable-all-EP-s-on-disconnect/20180919-104259
base: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
smatch warnings:
drivers/usb/dwc2/gadget.c:4024 dwc2_hsotg_ep_disable() error: double un
h adds a dereference
5662
5663 if (!IS_ERR(fotg210->pclk))
5664 clk_disable_unprepare(fotg210->pclk);
5665
5666 if (!hcd)
^^^
The old code assumes "hcd" can be NULL.
5667 return 0;
5668
regards,
dan carpenter
A malicious USB device could set port_number to -3 and we would
underflow the edge_serial->serial->port[] array.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 6d1d6efa3055..fa2
The > should be >= here so that we don't read one element beyond the end
of the ep->stream_info->stream_rings[] array.
Fixes: e9df17eb1408 ("USB: xhci: Correct assumptions about number of rings per
endpoint.")
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/ho
341: fix control-message error handling")
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index bdd7a5ad3bf1..3bb1fff02bed 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -128,7 +128,7 @@ static int ch341_control_i
We accidentally return 1 instead of negative error codes.
Fixes: df44831ee2dd ("USB host: Add USB ehci support for nuvoton npcm7xx
platform")
Signed-off-by: Dan Carpenter
---
v2: fix typo in the commit message
diff --git a/drivers/usb/host/ehci-npcm7xx.c b/drivers/usb/host/ehci-npcm7
We accidentally return 1 instead instead the negative error codes.
Fixes: df44831ee2dd ("USB host: Add USB ehci support for nuvoton npcm7xx
platform")
Signed-off-by: Dan Carpenter
---
The original patch used the "USB host:" prefix. This is driver code and
not generic USB
The tcpm_set_state() function take msecs not jiffies.
Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
index 8a201dd53d36..0dfd755020f4 100644
--- a/drivers/usb/typec/tc
isconnect(musb);
830 break;
831 case OTG_STATE_A_PERIPHERAL:
832 musb_hnp_stop(musb);
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
l %02x",
800 usb_otg_state_string(musb->xceiv->otg->state),
devctl);
801 }
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Apr 18, 2018 at 08:33:52AM -0500, Bin Liu wrote:
> Hi Dan,
>
> I appreciate you scaning the patches and reporting the issues.
>
These are kbuild stuff so I basically just forward them. It's no
effort.
> On Wed, Apr 18, 2018 at 10:25:34AM +0300, Dan Carpent
Hi Bin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on balbi-usb/next]
[also build test WARNING on v4.17-rc1 next-20180417]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system]
url:
https://github.com/0day-ci/linux/
7;s reasonable. Thanks!
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
rt(chip->tcpci);
Can you put the "return err;" back, because that's better style. It's
better to keep the error path and success path separate if you can.
if (err < 0) {
tcpci_unregister_port(chip->tcpci);
return err;
}
return 0;
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Minas,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on next-20180309]
[cannot apply to v4.16-rc4 v4.16-rc3 v4.16-rc2 v4.16-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system]
url:
https://github.com/0d
On Fri, Mar 23, 2018 at 02:16:23PM +0800, Kai-Heng Feng wrote:
> Hi Dan,
>
> Dan Carpenter wrote:
>
> > Hello Kai-Heng Feng,
> >
> > This is a semi-automatic email about new static checker warnings.
>
> I ran Smatch but didn't see the error message:
d = pid, .flags = flags };
128 }
129
130 if (i < quirk_count)
131 quirk_count = i;
132
133 unlock:
134 mutex_unlock(&quirk_mutex);
135
136 return param_set_copystring(val, kp);
The code is supposed to clear the RH_A_NPS and RH_A_PSM bits, but it's
a no-op because of the & vs | typo. This bug predates git and it was
only discovered using static analysis so it must not affect too many
people in real life.
Signed-off-by: Dan Carpenter
---
Not tested.
dif
gt; - oldmem == NULL;
> + oldmem = NULL;
> }
> #else
This bug would cause a GCC warning if it were ever compiled. This
ifdefed code is dead. We should just delete it.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubs
tty_port_register_device() returns error pointers on error, never NULL.
The IS_ERR_OR_NULL() function returns either 1 or 0 so it means we
return 1 on error instead of a proper error code. The caller only
checks for zero vs non-zero so this doesn't affect runtime.
Signed-off-by: Dan Carp
On Thu, Dec 14, 2017 at 11:01:15AM -0700, Shuah Khan wrote:
> Hi Dan,
>
> On 12/14/2017 12:58 AM, Dan Carpenter wrote:
> > Hello Shuah Khan,
> >
> > The patch c6688ef9f297: "usbip: fix stub_rx: harden CMD_SUBMIT path
> > to handle malicious input&quo
_buffer_length,
489 GFP_KERNEL);
490 if (!priv->urb->transfer_buffer) {
491 usbip_event_add(ud, SDEV_EVENT_ERROR_MALLOC);
492 return;
493 }
494 }
regards,
dan carpenter
--
To unsubscr
t;
> > Would you dare to resend this update suggestion after such a view?
>
> Of course. That was implied.
>
No. Greg maintains USB and he's has blocked Markus, because he never
listens to feedback but instead just repsonds that he has a different
opinion.
regards,
dan carpenter
so have a special static checker warning for when people do:
foo = alloc();
BUG_ON(!foo);
People do that occasionally but fortunately it's pretty rare. 10 years
ago that's how btrfs did error handling, but now there are only 4 of
these still remaining in btrfs.
regards,
da
and some other part of the system will be killed and fail.
Right.
> 3. This driver uses GFP_ATOMIC, is that guaranteed to succeed? I think not.
>
Right again. I was missing the first email in the thread because of my
email filters so I didn't see this was atomic.
regards,
dan carp
what purpose the memory is being allocated; hence when a failure
> > occurs they cannot tell what device (or other part of the system) will
> > be affected.
>
> If even allocation of 24 bytes fails, lots of other devices and other parts of
> the system will start failing really soon...
>
Small allocations never fail in the current kernel.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Dec 06, 2017 at 01:12:32PM +0100, Julia Lawall wrote:
>
>
> On Wed, 6 Dec 2017, SF Markus Elfring wrote:
>
> > From: Markus Elfring
> > Date: Wed, 6 Dec 2017 13:03:21 +0100
> >
> > Omit an extra message for a memory allocation failure in this function.
> >
> > This issue was detected by
On Mon, Oct 30, 2017 at 02:03:13PM +0100, Ulf Hansson wrote:
> On 30 October 2017 at 13:15, Dan Carpenter wrote:
> > On Mon, Oct 30, 2017 at 12:40:39PM +0100, Ulf Hansson wrote:
> >> On 27 October 2017 at 21:31, SF Markus Elfring
> >> wrote:
> >> > From: M
On Mon, Oct 30, 2017 at 12:40:39PM +0100, Ulf Hansson wrote:
> On 27 October 2017 at 21:31, SF Markus Elfring
> wrote:
> > From: Markus Elfring
> > Date: Fri, 27 Oct 2017 21:21:40 +0200
> >
> > Add a jump target so that a specific string copy operation is stored
> > only once at the end of this f
which
> > removes the NULL check and add a Reported-by: for me?
> It is already in the v2 (and v3) of my initial patch.
> https://www.spinics.net/lists/devicetree/msg199901.html
>
> Should I make a brand new patch (not another version)?
Yeah. Greg never rebases once the tree has b
if
> the device do not have a platform_data.
>
In that case, let's drop my patch. Could you send a patch for which
removes the NULL check and add a Reported-by: for me?
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a messag
We can't return directly in max3421_hub_control(), we have to unlock
first.
Fixes: 721fdc83b31b ("usb: max3421: Add devicetree support")
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index 928a5aabee02..46a86a7f33
ct other users / the
> >kernels memory, it only stops the userspace process making the call
> >from shooting itself in the foot.
>
> Okay, breaking userspace is reason enough all by itself to revert this
> change. I didn't realize that libusb sets the buffer_length
m66592->ep[0].fifosel = M66592_CFIFOSEL;
1651 m66592->ep[0].fifoctr = M66592_CFIFOCTR;
1652 m66592->ep[0].fifotrn = 0;
1653 m66592->ep[0].pipectr = get_pipectr_addr(0);
1654 m66592->pipenum2ep[0] = &m66592->ep[0];
1655 m66592
On Sat, Sep 30, 2017 at 11:04:35AM -0700, Deepa Dinamani wrote:
> On Sat, Sep 30, 2017 at 1:15 AM, Dan Carpenter
> wrote:
> > There used to be a test against "if (param->sglen > MAX_SGLEN)" but it
> > was removed during a refactor. It leads to an integer ov
eue() as well if
"param->iterations" is too high. I don't immediately see that it's
harmful but I've added a check to prevent it and silence the static
checker warning.
Fixes: 18fc4ebdc705 ("usb: misc: usbtest: Remove timeval usage")
Signed-off-by: Dan Carpenter
d270cbfb ("USB: Increase usbfs transfer limit")
Signed-off-by: Dan Carpenter
---
v2: Cast the ->buffer_length to unsigned int which is more readable than
relying on type promotion.
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 318bb3b96687..4664e543cf2f 100644
The user buffer has "uurb->buffer_length" bytes. If the kernel has more
information than that, we should truncate it instead of writing past
the end of the user's buffer. I added a WARN_ONCE() to help the user
debug the issue.
Reported-by: Alan Stern
Signed-off-by: Dan Carpen
On Thu, Sep 21, 2017 at 10:17:03AM -0400, Alan Stern wrote:
> On Thu, 21 Sep 2017, Dan Carpenter wrote:
>
> > There used to be an integer overflow check in proc_do_submiturb() but
> > it accidentally got removed. We need to put it back. The
>
> The removal was de
On Thu, Sep 21, 2017 at 10:17:03AM -0400, Alan Stern wrote:
> On Thu, 21 Sep 2017, Dan Carpenter wrote:
>
> > There used to be an integer overflow check in proc_do_submiturb() but
> > it accidentally got removed. We need to put it back. The
>
> The removal was de
_UP(uurb->buffer_length, USB_SG_SIZE);
Fixes: 1129d270cbfb ("USB: Increase usbfs transfer limit")
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 318bb3b96687..f3c9cff2101c 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/c
> + bool vbus_present = false;
> > + int i;
>
> unsigned int i; ?
>
int i is fine. Static checkers which complain about stuff like that
should be uninstalled.
> > +
> > + for (i = 0; i < ARRAY_SIZE(vbus_cable_ids); i++) {
regards,
dan carpenter
return x->set_power(x, mA);
329 return 0;
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
"udc->regs" is zero here. We don't set it until a couple lines later.
The intent was to test "udc->virt_addr".
Fixes: 1b9f35adb0ff ("usb: gadget: udc: Add Synopsys UDC Platform driver")
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/gadget/udc/
NULL here, but I'm not sure if something else was
intended?
918 list_add_tail(&req->queue, &ep->queue);
919 spin_unlock_irqrestore(&udc->lock, flags);
920
921 return 0;
regards,
dan carpenter
--
To unsubscribe from this list: se
^
1356 vhci->vhci_hcd_ss = NULL;
^
vhci is never initialized.
1357 return ret;
1358 }
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message t
gt; - kfree(data);
> - return ERR_PTR(-EFAULT);
> - }
> + data = memdup_user(buf, len);
> + if (unlikely(IS_ERR(data)))
Don't use likely/unlikely() here. It's not a fast path.
regards,
dan carpenter
--
To unsubscribe from this list: send the line &
"ep->udc->lock" and "udc->lock" are the same thing. It confuses Smatch
if we don't use the same name consistently.
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/gadget/udc/udc-xilinx.c
b/drivers/usb/gadget/udc/udc-xilinx.c
index 588e2531b8b8..de2
81 spin_lock_irqsave(&xhci->lock, flags);
582 }
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
e.
383 free_ep_req(hidg->in_ep, hidg->req);
^
This is also a dereference.
384 /*
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a messa
to send RESEND_CTS_STATE on both the failure and success paths.
147
148 /* Request CTS line state, sometimes during opening the current
149 * CTS state can be missed. */
150 send_control_msg(port, RESEND_CTS_STATE, 1);
151
152 return res;
166
167 __raw_writel(uhcrhda, pxa_ohci->mmio_base + UHCRHDA);
168 __raw_writel(uhcrhdb, pxa_ohci->mmio_base + UHCRHDB);
169 return 0;
170 }
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of
We normally use the passed in gfp flags for allocations, it's just these
two which were missed.
Fixes: 22d45f01a836 ("usb/xhci: replace pci_*_consistent() with
dma_*_coherent()")
Signed-off-by: Dan Carpenter
---
>From static analysis. Not tested.
diff --git a/drivers/usb
Smatch sometimes does have false positives because it thinks foo->array
is a dereference when really we're taking the address of the array. I
should fix that... But it understands that container_of(NULL) is ok.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "u
ven clear to me what we are trying to
do here.
3156 default:
3157 return (bool) (func->ffs->user_flags &
3158 FUNCTIONFS_ALL_CTRL_RECIP);
3159 }
3160 }
regards,
dan carpenter
--
To unsubscribe from this list: se
v_to_vhci() function.
464 unsigned long flags;
465
466 if (!vdev) {
^
Old code assumed "vdev" could be NULL.
467 pr_err("could not get virtual device");
468 return;
regards,
dan ca
We can't assign -EINVAL to a u16.
Fixes: 3948f0e0c999 ('usb: add Freescale QE/CPM USB peripheral controller
driver')
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c
b/drivers/usb/gadget/udc/fsl_qe_udc.c
index 93d28cb..901366f 100644
--- a/drivers
The udc->eps[] array has USB_MAX_ENDPOINTS elements so > should be >=.
Fixes: 3948f0e0c999 ('usb: add Freescale QE/CPM USB peripheral controller
driver')
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c
b/drivers/usb/gadget/udc/fsl_qe_udc.c
ind
9 maxp *= multi;
3970
3971 stream->buf0 = cpu_to_hc32(fotg210, (epnum << 8) | dev->devnum);
3972 stream->buf1 = cpu_to_hc32(fotg210, buf1);
3973 stream->buf2 = cpu_to_hc32(fotg210, multi);
regards,
dan carpenter
--
To unsubscribe from t
Return -ENOMEM if kmalloc() fails.
Fixes: 9353afbbfa7b ('usb: gadget: f_fs: buffer data from ‘oversized’ OUT
requests')
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/gadget/function/f_fs.c
b/drivers/usb/gadget/function/f_fs.c
index a91fcb0..5c8429f 100644
--- a/drivers/
On Sat, May 28, 2016 at 12:15:24PM +0200, Michal Nazarewicz wrote:
> On Sat, May 28 2016, Dan Carpenter wrote:
> > Also in the kernel we have to declare variables at the start of the
> > block.
>
> /me shrugs
>
> I looked at this out of curiosity and there are prec
On Sat, May 28, 2016 at 12:15:24PM +0200, Michal Nazarewicz wrote:
> On Sat, May 28 2016, Dan Carpenter wrote:
> > Also in the kernel we have to declare variables at the start of the
> > block.
>
> /me shrugs
>
> I looked at this out of curiosity and there are prec
This loop is supposed to set all the .num[] values to -1 but it's off by
one so it skips the first element and sets one element past the end of
the array.
I've cleaned up the loop a little as well.
Fixes: ddf8abd25994 ('USB: f_fs: the FunctionFS driver')
Signed-off-by: D
On Fri, May 27, 2016 at 07:25:30PM +0200, walter harms wrote:
>
>
> Am 27.05.2016 14:23, schrieb Michal Nazarewicz:
> > On Fri, May 27 2016, Dan Carpenter wrote:
> >> diff --git a/drivers/usb/gadget/function/f_fs.c
> >> b/drivers/usb/gadget/function/f_fs.c
&
994 ('USB: f_fs: the FunctionFS driver')
Signed-off-by: Dan Carpenter
---
I just spotted this reviewing the code, I have not tested it. Please
review carefully, the vla_ptr() macro is difficult to understand.
diff --git a/drivers/usb/gadget/function/f_fs.c
b/drivers/usb/gadget/function
If the call to fn() fails then "buf" is uninitialized. Just return the
error code in that case.
Signed-off-by: Dan Carpenter
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 2edc2bc..d9d2806 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/
If the fn() calls fail then "buf" is uninitialized. Just return early
in that situation.
Signed-off-by: Dan Carpenter
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index c369db9..9af9799 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.
In the original DWC3_DCFG_NUMP() was always zero. It looks like the
intent was to shift first and then do the mask.
Fixes: 2a58f9c12bb3 ('usb: dwc3: gadget: disable automatic calculation of ACK
TP NUMP')
Signed-off-by: Dan Carpenter
diff --git a/drivers/usb/dwc3/core.h b/driver
ROM_ID = eprom_read(dev, 0); /* first read EEPROM ID out; */
> + ret = eprom_read(dev, 0); /* first read EEPROM ID out; */
> + if (ret)
> + return;
> + wEPROM_ID = (u16)ret;
This is wrong and nonsense.
I'm not reviewing the rest of the patch seri
1 - 100 of 338 matches
Mail list logo