<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/can/usb/usb_8dev.c, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-08-25T09:17:46Z</updated>
<entry>
<title>can: usb_8dev: do not report txerr and rxerr during bus-off</title>
<updated>2022-08-25T09:17:46Z</updated>
<author>
<name>Vincent Mailhol</name>
</author>
<published>2022-07-19T14:35:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61bcc556ff8c81d52bd2b54f3c2f5a3901fd66ca'/>
<id>urn:sha1:61bcc556ff8c81d52bd2b54f3c2f5a3901fd66ca</id>
<content type='text'>
[ Upstream commit aebe8a2433cd090ccdc222861f44bddb75eb01de ]

During bus off, the error count is greater than 255 and can not fit in
a u8.

Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices")
Link: https://lore.kernel.org/all/20220719143550.3681-10-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol &lt;mailhol.vincent@wanadoo.fr&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>can: usb_8dev: usb_8dev_start_xmit(): fix double dev_kfree_skb() in error path</title>
<updated>2022-04-27T11:50:45Z</updated>
<author>
<name>Hangyu Hua</name>
</author>
<published>2022-03-11T08:06:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=660784e7194ac2953aebe874c1f75f2441ba3d19'/>
<id>urn:sha1:660784e7194ac2953aebe874c1f75f2441ba3d19</id>
<content type='text'>
commit 3d3925ff6433f98992685a9679613a2cc97f3ce2 upstream.

There is no need to call dev_kfree_skb() when usb_submit_urb() fails
because can_put_echo_skb() deletes original skb and
can_free_echo_skb() deletes the cloned skb.

Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices")
Link: https://lore.kernel.org/all/20220311080614.45229-1-hbh25y@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Hangyu Hua &lt;hbh25y@gmail.com&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
[DP: adjusted params of can_free_echo_skb() for 5.4 stable]
Signed-off-by: Dragos-Marian Panait &lt;dragos.panait@windriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>can: usb_8dev: fix memory leak</title>
<updated>2021-08-04T10:27:38Z</updated>
<author>
<name>Pavel Skripkin</name>
</author>
<published>2021-07-27T16:59:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8198673892761358cfe21a6b3cbf0a84640db2e4'/>
<id>urn:sha1:8198673892761358cfe21a6b3cbf0a84640db2e4</id>
<content type='text'>
commit 0e865f0c31928d6a313269ef624907eec55287c4 upstream.

In usb_8dev_start() MAX_RX_URBS coherent buffers are allocated and
there is nothing, that frees them:

1) In callback function the urb is resubmitted and that's all
2) In disconnect function urbs are simply killed, but URB_FREE_BUFFER
   is not set (see usb_8dev_start) and this flag cannot be used with
   coherent buffers.

So, all allocated buffers should be freed with usb_free_coherent()
explicitly.

Side note: This code looks like a copy-paste of other can drivers. The
same patch was applied to mcba_usb driver and it works nice with real
hardware. There is no change in functionality, only clean-up code for
coherent buffers.

Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices")
Link: https://lore.kernel.org/r/d39b458cd425a1cf7f512f340224e6e9563b07bd.1627404470.git.paskripkin@gmail.com
Cc: linux-stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Pavel Skripkin &lt;paskripkin@gmail.com&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>can: usb_8dev: fix use-after-free on disconnect</title>
<updated>2019-11-04T20:47:20Z</updated>
<author>
<name>Johan Hovold</name>
</author>
<published>2019-10-01T10:29:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3759739426186a924675651b388d1c3963c5710e'/>
<id>urn:sha1:3759739426186a924675651b388d1c3963c5710e</id>
<content type='text'>
The driver was accessing its driver data after having freed it.

Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices")
Cc: stable &lt;stable@vger.kernel.org&gt;     # 3.9
Cc: Bernd Krumboeck &lt;b.krumboeck@gmail.com&gt;
Cc: Wolfgang Grandegger &lt;wg@grandegger.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 412</title>
<updated>2019-06-05T15:37:14Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-06-01T08:08:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d8bc5106988ce98c579d51e4fdbacba37e15185'/>
<id>urn:sha1:4d8bc5106988ce98c579d51e4fdbacba37e15185</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation version 2 of the license this program
  is distributed in the hope that it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details you should have received a copy of the gnu general
  public license along with this program

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 2 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190531190112.858563475@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>can: usb_8dev: cancel urb on -EPIPE and -EPROTO</title>
<updated>2017-12-08T09:45:11Z</updated>
<author>
<name>Martin Kelly</name>
</author>
<published>2017-12-05T19:15:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=12147edc434c9e4c7c2f5fee2e5519b2e5ac34ce'/>
<id>urn:sha1:12147edc434c9e4c7c2f5fee2e5519b2e5ac34ce</id>
<content type='text'>
In mcba_usb, we have observed that when you unplug the device, the driver will
endlessly resubmit failing URBs, which can cause CPU stalls. This issue
is fixed in mcba_usb by catching the codes seen on device disconnect
(-EPIPE and -EPROTO).

This driver also resubmits in the case of -EPIPE and -EPROTO, so fix it
in the same way.

Signed-off-by: Martin Kelly &lt;mkelly@xevo.com&gt;
Cc: linux-stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: usb_8dev: Fix memory leak of priv-&gt;cmd_msg_buffer</title>
<updated>2017-03-03T12:00:07Z</updated>
<author>
<name>Marc Kleine-Budde</name>
</author>
<published>2017-03-02T11:03:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7c42631376306fb3f34d51fda546b50a9b6dd6ec'/>
<id>urn:sha1:7c42631376306fb3f34d51fda546b50a9b6dd6ec</id>
<content type='text'>
The priv-&gt;cmd_msg_buffer is allocated in the probe function, but never
kfree()ed. This patch converts the kzalloc() to resource-managed
kzalloc.

Cc: linux-stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>net: can: usb: usb_8dev: don't print error when allocating urb fails</title>
<updated>2016-08-13T21:53:39Z</updated>
<author>
<name>Wolfram Sang</name>
</author>
<published>2016-08-11T21:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7fe7cfa43a99056ffa52aed4053693dedc3cbbbb'/>
<id>urn:sha1:7fe7cfa43a99056ffa52aed4053693dedc3cbbbb</id>
<content type='text'>
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang &lt;wsa-dev@sang-engineering.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>can: remove obsolete assignment for CAN protocol error type</title>
<updated>2015-11-23T08:37:38Z</updated>
<author>
<name>Oliver Hartkopp</name>
</author>
<published>2015-11-21T17:41:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a2ec19f888f1fb06e2424486423a16f86ad1fcc4'/>
<id>urn:sha1:a2ec19f888f1fb06e2424486423a16f86ad1fcc4</id>
<content type='text'>
The assignment 'cf-&gt;data[2] |= CAN_ERR_PROT_UNSPEC' used at CAN error message
creation time is obsolete as CAN_ERR_PROT_UNSPEC is zero and cf-&gt;data[2] is
initialized with zero in alloc_can_err_skb() anyway.

So we could either assign 'cf-&gt;data[2] = CAN_ERR_PROT_UNSPEC' correctly or we
can remove the obsolete OR operation entirely.

Signed-off-by: Oliver Hartkopp &lt;socketcan@hartkopp.net&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: fix assignment of error location in CAN error messages</title>
<updated>2015-11-23T08:37:34Z</updated>
<author>
<name>Oliver Hartkopp</name>
</author>
<published>2015-11-21T17:41:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ffd461f80d536336811d573f197f3e6d9872d054'/>
<id>urn:sha1:ffd461f80d536336811d573f197f3e6d9872d054</id>
<content type='text'>
As Dan Carpenter reported in http://marc.info/?l=linux-can&amp;m=144793696016187
the assignment of the error location in CAN error messages had some bit wise
overlaps. Indeed the value to be assigned in data[3] is no bitfield but defines
a single value which points to a location inside the CAN frame on the wire.

This patch fixes the assignments for the error locations in error messages.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Oliver Hartkopp &lt;socketcan@hartkopp.net&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
</feed>
