Skip to content

Commit f65dca1

Browse files
author
Paolo Abeni
committed
Merge tag 'linux-can-fixes-for-6.16-20250529' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says: ==================== pull-request: can 2025-05-29 this is a pull request of 1 patch for net/main. The patch is by Fedor Pchelkin and fixes a slab-out-of-bounds access in the kvaser_pciefd driver. linux-can-fixes-for-6.16-20250529 * tag 'linux-can-fixes-for-6.16-20250529' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: kvaser_pciefd: refine error prone echo_skb_max handling logic ==================== Link: https://patch.msgid.link/20250529075313.1101820-1-mkl@pengutronix.de Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents 54d3416 + 54ec8b0 commit f65dca1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/can/kvaser_pciefd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ static int kvaser_pciefd_setup_can_ctrls(struct kvaser_pciefd *pcie)
966966
u32 status, tx_nr_packets_max;
967967

968968
netdev = alloc_candev(sizeof(struct kvaser_pciefd_can),
969-
KVASER_PCIEFD_CAN_TX_MAX_COUNT);
969+
roundup_pow_of_two(KVASER_PCIEFD_CAN_TX_MAX_COUNT));
970970
if (!netdev)
971971
return -ENOMEM;
972972

@@ -995,7 +995,6 @@ static int kvaser_pciefd_setup_can_ctrls(struct kvaser_pciefd *pcie)
995995
can->tx_max_count = min(KVASER_PCIEFD_CAN_TX_MAX_COUNT, tx_nr_packets_max - 1);
996996

997997
can->can.clock.freq = pcie->freq;
998-
can->can.echo_skb_max = roundup_pow_of_two(can->tx_max_count);
999998
spin_lock_init(&can->lock);
1000999

10011000
can->can.bittiming_const = &kvaser_pciefd_bittiming_const;

0 commit comments

Comments
 (0)