linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull-request: can-next 2021-04-26
@ 2021-04-26  6:54 Marc Kleine-Budde
  2021-04-26  6:54 ` [net-next 1/4] can: etas_es58x: Fix missing null check on netdev pointer Marc Kleine-Budde
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2021-04-26  6:54 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel

Hello Jakub, hello David,

this is a pull request of 4 patches for net-next/master.

the first two patches are from Colin Ian King and target the
etas_es58x driver, they add a missing NULL pointer check and fix some
typos.

The next two patches are by Erik Flodin. The first one updates the CAN
documentation regarding filtering, the other one fixes the header
alignment in CAN related proc output on 64 bit systems.

regards,
Marc

---

The following changes since commit b2f0ca00e6b34bd57c9298a869ea133699e8ec39:

  phy: nxp-c45-tja11xx: add interrupt support (2021-04-23 14:13:16 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git tags/linux-can-next-for-5.13-20210426

for you to fetch changes up to e6b031d3c37f79d135c642834bdda7233a29db8d:

  can: proc: fix rcvlist_* header alignment on 64-bit system (2021-04-25 19:43:00 +0200)

----------------------------------------------------------------
linux-can-next-for-5.13-20210426

----------------------------------------------------------------
Colin Ian King (2):
      can: etas_es58x: Fix missing null check on netdev pointer
      can: etas_es58x: Fix a couple of spelling mistakes

Erik Flodin (2):
      can: add a note that RECV_OWN_MSGS frames are subject to filtering
      can: proc: fix rcvlist_* header alignment on 64-bit system

 Documentation/networking/can.rst            | 2 ++
 drivers/net/can/usb/etas_es58x/es58x_core.c | 4 ++--
 drivers/net/can/usb/etas_es58x/es58x_core.h | 2 +-
 net/can/proc.c                              | 6 ++++--
 4 files changed, 9 insertions(+), 5 deletions(-)



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

* [net-next 1/4] can: etas_es58x: Fix missing null check on netdev pointer
  2021-04-26  6:54 pull-request: can-next 2021-04-26 Marc Kleine-Budde
@ 2021-04-26  6:54 ` Marc Kleine-Budde
  2021-04-26  6:54 ` [net-next 2/4] can: etas_es58x: Fix a couple of spelling mistakes Marc Kleine-Budde
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2021-04-26  6:54 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, linux-can, kernel, Colin Ian King, Vincent Mailhol,
	Marc Kleine-Budde

From: Colin Ian King <colin.king@canonical.com>

There is an assignment to *netdev that is that can potentially be null
but the null check is checking netdev and not *netdev as intended. Fix
this by adding in the missing * operator.

Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
Link: https://lore.kernel.org/r/20210415084723.1807935-1-colin.king@canonical.com
Addresses-Coverity: ("Dereference before null check")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/etas_es58x/es58x_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.h b/drivers/net/can/usb/etas_es58x/es58x_core.h
index 5f4e7dc5be35..fcf219e727bf 100644
--- a/drivers/net/can/usb/etas_es58x/es58x_core.h
+++ b/drivers/net/can/usb/etas_es58x/es58x_core.h
@@ -625,7 +625,7 @@ static inline int es58x_get_netdev(struct es58x_device *es58x_dev,
 		return -ECHRNG;
 
 	*netdev = es58x_dev->netdev[channel_idx];
-	if (!netdev || !netif_device_present(*netdev))
+	if (!*netdev || !netif_device_present(*netdev))
 		return -ENODEV;
 
 	return 0;

base-commit: b2f0ca00e6b34bd57c9298a869ea133699e8ec39
-- 
2.30.2



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

* [net-next 2/4] can: etas_es58x: Fix a couple of spelling mistakes
  2021-04-26  6:54 pull-request: can-next 2021-04-26 Marc Kleine-Budde
  2021-04-26  6:54 ` [net-next 1/4] can: etas_es58x: Fix missing null check on netdev pointer Marc Kleine-Budde
@ 2021-04-26  6:54 ` Marc Kleine-Budde
  2021-04-26  6:54 ` [net-next 3/4] can: add a note that RECV_OWN_MSGS frames are subject to filtering Marc Kleine-Budde
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2021-04-26  6:54 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel, Colin Ian King, Marc Kleine-Budde

From: Colin Ian King <colin.king@canonical.com>

There are spelling mistakes in netdev_dbg and netdev_dbg messages,
fix these.

Link: https://lore.kernel.org/r/20210415113050.1942333-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/etas_es58x/es58x_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c
index 57e5f94468e9..8e9102482c52 100644
--- a/drivers/net/can/usb/etas_es58x/es58x_core.c
+++ b/drivers/net/can/usb/etas_es58x/es58x_core.c
@@ -688,7 +688,7 @@ int es58x_rx_err_msg(struct net_device *netdev, enum es58x_err error,
 
 	case ES58X_ERR_PROT_STUFF:
 		if (net_ratelimit())
-			netdev_dbg(netdev, "Error BITSUFF\n");
+			netdev_dbg(netdev, "Error BITSTUFF\n");
 		if (cf)
 			cf->data[2] |= CAN_ERR_PROT_STUFF;
 		break;
@@ -1015,7 +1015,7 @@ int es58x_rx_cmd_ret_u32(struct net_device *netdev,
 			int ret;
 
 			netdev_warn(netdev,
-				    "%s: channel is already opened, closing and re-openning it to reflect new configuration\n",
+				    "%s: channel is already opened, closing and re-opening it to reflect new configuration\n",
 				    ret_desc);
 			ret = ops->disable_channel(es58x_priv(netdev));
 			if (ret)
-- 
2.30.2



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

* [net-next 3/4] can: add a note that RECV_OWN_MSGS frames are subject to filtering
  2021-04-26  6:54 pull-request: can-next 2021-04-26 Marc Kleine-Budde
  2021-04-26  6:54 ` [net-next 1/4] can: etas_es58x: Fix missing null check on netdev pointer Marc Kleine-Budde
  2021-04-26  6:54 ` [net-next 2/4] can: etas_es58x: Fix a couple of spelling mistakes Marc Kleine-Budde
@ 2021-04-26  6:54 ` Marc Kleine-Budde
  2021-04-26  6:54 ` [net-next 4/4] can: proc: fix rcvlist_* header alignment on 64-bit system Marc Kleine-Budde
  2021-04-26 20:00 ` pull-request: can-next 2021-04-26 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2021-04-26  6:54 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel, Erik Flodin, Marc Kleine-Budde

From: Erik Flodin <erik@flodin.me>

Some parts of the documentation may lead the reader to think that the
socket's own frames are always received when CAN_RAW_RECV_OWN_MSGS is
enabled, but all frames are subject to filtering.

As explained by Marc Kleine-Budde:

On TX complete of a CAN frame it's pushed into the RX path of the
networking stack, along with the information of the originating socket.

Then the CAN frame is delivered into AF_CAN, where it is passed on to
all registered receivers depending on filters. One receiver is the
sending socket in CAN_RAW. Then in CAN_RAW the it is checked if the
sending socket has RECV_OWN_MSGS enabled.

Link: https://lore.kernel.org/r/20210420191212.42753-1-erik@flodin.me
Signed-off-by: Erik Flodin <erik@flodin.me>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 Documentation/networking/can.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/networking/can.rst b/Documentation/networking/can.rst
index f8dae662e454..f34cb0e4460e 100644
--- a/Documentation/networking/can.rst
+++ b/Documentation/networking/can.rst
@@ -608,6 +608,8 @@ demand:
     setsockopt(s, SOL_CAN_RAW, CAN_RAW_RECV_OWN_MSGS,
                &recv_own_msgs, sizeof(recv_own_msgs));
 
+Note that reception of a socket's own CAN frames are subject to the same
+filtering as other CAN frames (see :ref:`socketcan-rawfilter`).
 
 .. _socketcan-rawfd:
 
-- 
2.30.2



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

* [net-next 4/4] can: proc: fix rcvlist_* header alignment on 64-bit system
  2021-04-26  6:54 pull-request: can-next 2021-04-26 Marc Kleine-Budde
                   ` (2 preceding siblings ...)
  2021-04-26  6:54 ` [net-next 3/4] can: add a note that RECV_OWN_MSGS frames are subject to filtering Marc Kleine-Budde
@ 2021-04-26  6:54 ` Marc Kleine-Budde
  2021-04-26 20:00 ` pull-request: can-next 2021-04-26 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2021-04-26  6:54 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel, Erik Flodin, Marc Kleine-Budde

From: Erik Flodin <erik@flodin.me>

Before this fix, the function and userdata columns weren't aligned:
  device   can_id   can_mask  function  userdata   matches  ident
   vcan0  92345678  9fffffff  0000000000000000  0000000000000000         0  raw
   vcan0     123    00000123  0000000000000000  0000000000000000         0  raw

After the fix they are:
  device   can_id   can_mask      function          userdata       matches  ident
   vcan0  92345678  9fffffff  0000000000000000  0000000000000000         0  raw
   vcan0     123    00000123  0000000000000000  0000000000000000         0  raw

Link: Link: https://lore.kernel.org/r/20210425141440.229653-1-erik@flodin.me
Signed-off-by: Erik Flodin <erik@flodin.me>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 net/can/proc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/can/proc.c b/net/can/proc.c
index b15760b5c1cc..d1fe49e6f16d 100644
--- a/net/can/proc.c
+++ b/net/can/proc.c
@@ -205,8 +205,10 @@ static void can_print_recv_banner(struct seq_file *m)
 	 *                  can1.  00000000  00000000  00000000
 	 *                 .......          0  tp20
 	 */
-	seq_puts(m, "  device   can_id   can_mask  function"
-			"  userdata   matches  ident\n");
+	if (IS_ENABLED(CONFIG_64BIT))
+		seq_puts(m, "  device   can_id   can_mask      function          userdata       matches  ident\n");
+	else
+		seq_puts(m, "  device   can_id   can_mask  function  userdata   matches  ident\n");
 }
 
 static int can_stats_proc_show(struct seq_file *m, void *v)
-- 
2.30.2



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

* Re: pull-request: can-next 2021-04-26
  2021-04-26  6:54 pull-request: can-next 2021-04-26 Marc Kleine-Budde
                   ` (3 preceding siblings ...)
  2021-04-26  6:54 ` [net-next 4/4] can: proc: fix rcvlist_* header alignment on 64-bit system Marc Kleine-Budde
@ 2021-04-26 20:00 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-26 20:00 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: netdev, davem, kuba, linux-can, kernel

Hello:

This pull request was applied to netdev/net-next.git (refs/heads/master):

On Mon, 26 Apr 2021 08:54:48 +0200 you wrote:
> Hello Jakub, hello David,
> 
> this is a pull request of 4 patches for net-next/master.
> 
> the first two patches are from Colin Ian King and target the
> etas_es58x driver, they add a missing NULL pointer check and fix some
> typos.
> 
> [...]

Here is the summary with links:
  - pull-request: can-next 2021-04-26
    https://git.kernel.org/netdev/net-next/c/d0c5d18da2da
  - [net-next,2/4] can: etas_es58x: Fix a couple of spelling mistakes
    https://git.kernel.org/netdev/net-next/c/1c9690dd308e
  - [net-next,3/4] can: add a note that RECV_OWN_MSGS frames are subject to filtering
    https://git.kernel.org/netdev/net-next/c/924e464f4a8a
  - [net-next,4/4] can: proc: fix rcvlist_* header alignment on 64-bit system
    https://git.kernel.org/netdev/net-next/c/e6b031d3c37f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-04-26 20:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26  6:54 pull-request: can-next 2021-04-26 Marc Kleine-Budde
2021-04-26  6:54 ` [net-next 1/4] can: etas_es58x: Fix missing null check on netdev pointer Marc Kleine-Budde
2021-04-26  6:54 ` [net-next 2/4] can: etas_es58x: Fix a couple of spelling mistakes Marc Kleine-Budde
2021-04-26  6:54 ` [net-next 3/4] can: add a note that RECV_OWN_MSGS frames are subject to filtering Marc Kleine-Budde
2021-04-26  6:54 ` [net-next 4/4] can: proc: fix rcvlist_* header alignment on 64-bit system Marc Kleine-Budde
2021-04-26 20:00 ` pull-request: can-next 2021-04-26 patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).