No description
Find a file
Marc Kleine-Budde f006229135 can: kvaser_usb: hydra: help gcc-13 to figure out cmd_len
Debian's gcc-13 [1] throws the following error in
kvaser_usb_hydra_cmd_size():

[1] gcc version 13.0.0 20221214 (experimental) [master r13-4693-g512098a3316] (Debian 13-20221214-1)

| drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c:502:65: error:
| array subscript ‘struct kvaser_cmd_ext[0]’ is partly outside array
| bounds of ‘unsigned char[32]’ [-Werror=array-bounds=]
|   502 |                 ret = le16_to_cpu(((struct kvaser_cmd_ext *)cmd)->len);

kvaser_usb_hydra_cmd_size() returns the size of given command. It
depends on the command number (cmd->header.cmd_no). For extended
commands (cmd->header.cmd_no == CMD_EXTENDED) the above shown code is
executed.

Help gcc to recognize that this code path is not taken in all cases,
by calling kvaser_usb_hydra_cmd_size() directly after assigning the
command number.

Fixes: aec5fb2268 ("can: kvaser_usb: Add support for Kvaser USB hydra family")
Cc: Jimmy Assarsson <extja@kvaser.com>
Cc: Anssi Hannula <anssi.hannula@bitwise.fi>
Link: https://lore.kernel.org/all/20221219110104.1073881-1-mkl@pengutronix.de
Tested-by: Jimmy Assarsson <extja@kvaser.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2022-12-19 16:08:27 +01:00
arch Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
block for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
certs certs: make system keyring depend on built-in x509 parser 2022-09-24 04:31:18 +09:00
crypto iov_iter work; most of that is about getting rid of 2022-12-12 18:29:54 -08:00
Documentation Documentation: devlink: add missing toc entry for etas_es58x devlink doc 2022-12-19 16:08:27 +01:00
drivers can: kvaser_usb: hydra: help gcc-13 to figure out cmd_len 2022-12-19 16:08:27 +01:00
fs EFI updates for v6.2: 2022-12-13 14:31:47 -08:00
include rxrpc: Fix switched parameters in peer tracing 2022-12-19 09:51:31 +00:00
init modules changes for v6.2-rc1 2022-12-13 14:05:39 -08:00
io_uring for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
ipc Non-MM patches for 6.2-rc1. 2022-12-12 17:28:58 -08:00
kernel bpf: Resolve fext program type when checking map compatibility 2022-12-14 21:30:27 -08:00
lib Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
LICENSES LICENSES/LGPL-2.1: Add LGPL-2.1-or-later as valid identifiers 2021-12-16 14:33:10 +01:00
mm for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
net net: stream: purge sk_error_queue in sk_stream_kill_queues() 2022-12-19 12:33:16 +00:00
rust rust: types: add Opaque type 2022-12-04 01:59:16 +01:00
samples Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
scripts Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
security integrity-v6.2 2022-12-13 14:22:50 -08:00
sound sound updates for 6.2-rc1 2022-12-13 11:27:26 -08:00
tools bpf-for-netdev 2022-12-16 10:41:56 -08:00
usr usr/gen_init_cpio.c: remove unnecessary -1 values from int file 2022-10-03 14:21:44 -07:00
virt Merge branch 'kvm-dwmw2-fixes' into HEAD 2022-11-23 18:59:45 -05:00
.clang-format printk changes for 6.2 2022-12-12 09:01:36 -08:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore get_maintainer: add Alan to .get_maintainer.ignore 2022-08-20 15:17:44 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore kbuild: Cleanup DT Overlay intermediate files as appropriate 2022-11-18 14:45:30 -06:00
.mailmap Non-MM patches for 6.2-rc1. 2022-12-12 17:28:58 -08:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Remove Michal Marek from Kbuild maintainers 2022-11-16 14:53:00 +09:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
Makefile This was a not-too-busy cycle for documentation; highlights include: 2022-12-12 17:18:50 -08:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.