summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorFedor Pchelkin <pchelkin@ispras.ru>2022-07-29 17:36:55 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2022-08-09 09:05:06 +0200
commit8ef49f7f8244424adcf4a546dba4cbbeb0b09c09 (patch)
tree3dd62149c949b849d06b817847331e927ded6da7 /net
parentb8c3bf0ed2edf2deaedba5f0bf0bb54c76dee71d (diff)
downloadlinux-8ef49f7f8244424adcf4a546dba4cbbeb0b09c09.tar.bz2
can: j1939: j1939_sk_queue_activate_next_locked(): replace WARN_ON_ONCE with netdev_warn_once()
We should warn user-space that it is doing something wrong when trying to activate sessions with identical parameters but WARN_ON_ONCE macro can not be used here as it serves a different purpose. So it would be good to replace it with netdev_warn_once() message. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.kernel.org/all/20220729143655.1108297-1-pchelkin@ispras.ru [mkl: fix indention] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r--net/can/j1939/socket.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c
index f5ecfdcf57b2..b670ba03a675 100644
--- a/net/can/j1939/socket.c
+++ b/net/can/j1939/socket.c
@@ -178,7 +178,10 @@ activate_next:
if (!first)
return;
- if (WARN_ON_ONCE(j1939_session_activate(first))) {
+ if (j1939_session_activate(first)) {
+ netdev_warn_once(first->priv->ndev,
+ "%s: 0x%p: Identical session is already activated.\n",
+ __func__, first);
first->err = -EBUSY;
goto activate_next;
} else {