Skip to content

Commit 58f43fc

Browse files
juerghpelwell
authored andcommitted
staging: vc-sm-cma: Fix field-spanning write warning
Replace one-element array with flexible-array member to fix: [ 11.725017] ------------[ cut here ]------------ [ 11.725038] memcpy: detected field-spanning write (size 4) of single field "hdr->body" at drivers/staging/vc04_services/vc-sm-cma/vc_sm_cma_vchi.c:130 (size 0) [ 11.725113] WARNING: CPU: 3 PID: 455 at drivers/staging/vc04_services/vc-sm-cma/vc_sm_cma_vchi.c:130 vc_vchi_cmd_create+0x1a8/0x1d0 [vc_sm_cma] Signed-off-by: Juerg Haefliger <[email protected]>
1 parent 99972b2 commit 58f43fc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/staging/vc04_services/vc-sm-cma/vc_sm_defs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ enum vc_sm_alloc_type_t {
9292
struct vc_sm_msg_hdr_t {
9393
u32 type;
9494
u32 trans_id;
95-
u8 body[0];
96-
95+
u8 body[];
9796
};
9897

9998
/* Request to allocate memory (HOST->VC) */

0 commit comments

Comments
 (0)