linux-can-fixes-for-6.14-20250208
-----BEGIN PGP SIGNATURE----- iQFHBAABCgAxFiEEn/sM2K9nqF/8FWzzDHRl3/mQkZwFAmenQ2MTHG1rbEBwZW5n dXRyb25peC5kZQAKCRAMdGXf+ZCRnM1SCACKSffnuZgemuq/Gl/2q30SSkDyvC7s D0C1VO32y2SmoBhfRmQqMKbGH6zbTTgPaDygUxfPEUBZ6P4wN7Cj8VsKk0LKRRZF pV2+VPRdIJjqDjsHHJY7FZSE7GBtEhS6KjOi4S4dOIYM3RdXCYMrIROqPYYnQMAX 97Gvn3eaY4pmXG7Uq6oavxMAiTgjdKHecsM1qF0/TtTTcbufSEy1PronZmej7mHQ vv8SDNIG8nxB8lE8s3pKgeNeHxgHMMLrYSUtvCkBOsScDWP6FVn4bIJen2lZ4NJD 5VHt6hwseAtZv9Zt+swnHFUiIuXPQNFmAZHE57IpFWSh9b4oUQWImUZz =Sq6N -----END PGP SIGNATURE----- Merge tag 'linux-can-fixes-for-6.14-20250208' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2025-02-08 The first patch is by Reyders Morales and fixes a code example in the CAN ISO15765-2 documentation. The next patch is contributed by Alexander Hölzl and fixes sending of J1939 messages with zero data length. Fedor Pchelkin's patch for the ctucanfd driver adds a missing handling for an skb allocation error. Krzysztof Kozlowski contributes a patch for the c_can driver to fix unbalanced runtime PM disable in error path. The next patch is by Vincent Mailhol and fixes a NULL pointer dereference on udev->serial in the etas_es58x driver. The patch is by Robin van der Gracht and fixes the handling for an skb allocation error. * tag 'linux-can-fixes-for-6.14-20250208' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: rockchip: rkcanfd_handle_rx_fifo_overflow_int(): bail out if skb cannot be allocated can: etas_es58x: fix potential NULL pointer dereference on udev->serial can: c_can: fix unbalanced runtime PM disable in error path can: ctucanfd: handle skb allocation failure can: j1939: j1939_sk_send_loop(): fix unable to send messages with data length zero Documentation/networking: fix basic node example document ISO 15765-2 ==================== Link: https://patch.msgid.link/20250208115120.237274-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
8e248f2dbb
7 changed files with 22 additions and 14 deletions
|
@ -369,8 +369,8 @@ to their default.
|
|||
|
||||
addr.can_family = AF_CAN;
|
||||
addr.can_ifindex = if_nametoindex("can0");
|
||||
addr.tp.tx_id = 0x18DA42F1 | CAN_EFF_FLAG;
|
||||
addr.tp.rx_id = 0x18DAF142 | CAN_EFF_FLAG;
|
||||
addr.can_addr.tp.tx_id = 0x18DA42F1 | CAN_EFF_FLAG;
|
||||
addr.can_addr.tp.rx_id = 0x18DAF142 | CAN_EFF_FLAG;
|
||||
|
||||
ret = bind(s, (struct sockaddr *)&addr, sizeof(addr));
|
||||
if (ret < 0)
|
||||
|
|
|
@ -385,15 +385,16 @@ static int c_can_plat_probe(struct platform_device *pdev)
|
|||
if (ret) {
|
||||
dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
|
||||
KBUILD_MODNAME, ret);
|
||||
goto exit_free_device;
|
||||
goto exit_pm_runtime;
|
||||
}
|
||||
|
||||
dev_info(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n",
|
||||
KBUILD_MODNAME, priv->base, dev->irq);
|
||||
return 0;
|
||||
|
||||
exit_free_device:
|
||||
exit_pm_runtime:
|
||||
pm_runtime_disable(priv->device);
|
||||
exit_free_device:
|
||||
free_c_can_dev(dev);
|
||||
exit:
|
||||
dev_err(&pdev->dev, "probe failed\n");
|
||||
|
|
|
@ -867,10 +867,12 @@ static void ctucan_err_interrupt(struct net_device *ndev, u32 isr)
|
|||
}
|
||||
break;
|
||||
case CAN_STATE_ERROR_ACTIVE:
|
||||
cf->can_id |= CAN_ERR_CNT;
|
||||
cf->data[1] = CAN_ERR_CRTL_ACTIVE;
|
||||
cf->data[6] = bec.txerr;
|
||||
cf->data[7] = bec.rxerr;
|
||||
if (skb) {
|
||||
cf->can_id |= CAN_ERR_CNT;
|
||||
cf->data[1] = CAN_ERR_CRTL_ACTIVE;
|
||||
cf->data[6] = bec.txerr;
|
||||
cf->data[7] = bec.rxerr;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
netdev_warn(ndev, "unhandled error state (%d:%s)!\n",
|
||||
|
|
|
@ -622,7 +622,7 @@ rkcanfd_handle_rx_fifo_overflow_int(struct rkcanfd_priv *priv)
|
|||
netdev_dbg(priv->ndev, "RX-FIFO overflow\n");
|
||||
|
||||
skb = rkcanfd_alloc_can_err_skb(priv, &cf, ×tamp);
|
||||
if (skb)
|
||||
if (!skb)
|
||||
return 0;
|
||||
|
||||
rkcanfd_get_berr_counter_corrected(priv, &bec);
|
||||
|
|
|
@ -248,7 +248,11 @@ static int es58x_devlink_info_get(struct devlink *devlink,
|
|||
return ret;
|
||||
}
|
||||
|
||||
return devlink_info_serial_number_put(req, es58x_dev->udev->serial);
|
||||
if (es58x_dev->udev->serial)
|
||||
ret = devlink_info_serial_number_put(req,
|
||||
es58x_dev->udev->serial);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const struct devlink_ops es58x_dl_ops = {
|
||||
|
|
|
@ -1132,7 +1132,7 @@ static int j1939_sk_send_loop(struct j1939_priv *priv, struct sock *sk,
|
|||
|
||||
todo_size = size;
|
||||
|
||||
while (todo_size) {
|
||||
do {
|
||||
struct j1939_sk_buff_cb *skcb;
|
||||
|
||||
segment_size = min_t(size_t, J1939_MAX_TP_PACKET_SIZE,
|
||||
|
@ -1177,7 +1177,7 @@ static int j1939_sk_send_loop(struct j1939_priv *priv, struct sock *sk,
|
|||
|
||||
todo_size -= segment_size;
|
||||
session->total_queued_size += segment_size;
|
||||
}
|
||||
} while (todo_size);
|
||||
|
||||
switch (ret) {
|
||||
case 0: /* OK */
|
||||
|
|
|
@ -382,8 +382,9 @@ sk_buff *j1939_session_skb_get_by_offset(struct j1939_session *session,
|
|||
skb_queue_walk(&session->skb_queue, do_skb) {
|
||||
do_skcb = j1939_skb_to_cb(do_skb);
|
||||
|
||||
if (offset_start >= do_skcb->offset &&
|
||||
offset_start < (do_skcb->offset + do_skb->len)) {
|
||||
if ((offset_start >= do_skcb->offset &&
|
||||
offset_start < (do_skcb->offset + do_skb->len)) ||
|
||||
(offset_start == 0 && do_skcb->offset == 0 && do_skb->len == 0)) {
|
||||
skb = do_skb;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue