Thread (16 messages) flat view 16 messages, 3 authors, 2d ago

Re: [PATCH net-next v2 2/7] net: mctp: usblib: Add test for splits inside headers

From: Simon Horman <horms@kernel.org>
Date: 2026-09-09 07:12:22
Also in: linux-hardening, lkml

On Thu, Sep 03, 2026 at 10:42:19AM +0800, James Lee wrote:

...
+static void mctp_usblib_test_rx_header_splits(struct kunit *test)
+{
+	struct mctp_usblib_test_dev *dev;
+	struct mctp_usblib_test_ctx *ctx;
+	struct mctp_usblib_rx *rx;
+	size_t i;
Hi James,

This is a minor problem and it is addressed in the following patch,
by removing the line above, but i is declared yet unused  and should
not be added here.

Flagged by W=1 builds with GCC 16.2.0 and Clang 22.1.8.
+
+	ctx = mctp_usblib_test_init(test);
+	rx = mctp_usblib_test_rx_init(test, true);
+	dev = ctx->dev;
+
+	/* Unrolling here so stack traces point to the invocation with the
+	 * failing length.
+	 */
+	mctp_usblib_test_rx_split_header(test, 1, dev, rx);
+	mctp_usblib_test_rx_split_header(test, 2, dev, rx);
+	mctp_usblib_test_rx_split_header(test, 3, dev, rx);
+	mctp_usblib_test_rx_split_header(test, 4, dev, rx);
+	mctp_usblib_test_rx_split_header(test, 5, dev, rx);
+	mctp_usblib_test_rx_split_header(test, 6, dev, rx);
+	mctp_usblib_test_rx_split_header(test, 7, dev, rx);
+	mctp_usblib_test_rx_split_header(test, 8, dev, rx);
+}
...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help