drivers/net/stack: Migrate struct rt_proc_call to flexible array member
PATCH 1/1 drivers/net/stack: Migrate struct rt_proc_call to flexible array member
This fixes the following WARNING:
memcpy: detected field-spanning write (size 80) of single field "call->priv_data" at drivers/xenomai/net/stack/rtnet_rtpc.c:93 (size 0)
Signed-off-by Hannes Diethelm <[email protected]>
--- kernel/drivers/net/stack/include/rtnet_rtpc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/drivers/net/stack/include/rtnet_rtpc.h +1 -1
@@ -43,7 +43,7 @@ struct rt_proc_call {atomic_t ref_count;wait_queue_head_t call_wq;rtpc_cleanup_proc cleanup_handler; - char priv_data[0] __attribute__((aligned(8))); + char priv_data[] __attribute__((aligned(8))); };#define CALL_PENDING 1000/* result value for blocked calls */
Signature · 1 line
2.47.3
Jan Kiszka
AppliedQuoted 13 lines · Hannes Diethelm
This fixes the following WARNING:
memcpy: detected field-spanning write (size 80) of single field "call->priv_data" atdrivers/xenomai/net/stack/rtnet_rtpc.c:93(size 0)Signed-off-by Hannes Diethelm <[email protected]>--- kernel/drivers/net/stack/include/rtnet_rtpc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/drivers/net/stack/include/rtnet_rtpc.h +0
-0
kernel/drivers/net/stack/include/rtnet_rtpc.h struct rt_proc_call { · line 49
Quoted 8 lines
kernel/drivers/net/stack/include/rtnet_rtpc.h +1
-1@@ -43,7 +43,7 @@ struct rt_proc_call {atomic_t ref_count;wait_queue_head_t call_wq;rtpc_cleanup_proc cleanup_handler; - char priv_data[0] __attribute__((aligned(8))); + char priv_data[] __attribute__((aligned(8))); };#define CALL_PENDING 1000/* result value for blocked calls */
Thanks, applied.
There are still more spots of that kind in the Xenomai code base. Those may not trigger the warning you see, at least so far, but if someone wants to dig into them as well, that would be great.
Jan
Signature · 2 lines
Siemens AG, Foundational Technologies Linux Expert Center