Skip to content

Commit a7de1de

Browse files
arndbkeithbusch
authored andcommitted
nvme: trace: avoid memcpy overflow warning
A previous patch introduced a struct_group() in nvme_common_command to help stringop fortification figure out the length of the fields, but one function is not currently using them: In file included from drivers/nvme/target/core.c:7: In file included from include/linux/string.h:254: include/linux/fortify-string.h:592:4: error: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror,-Wattribute-warning] __read_overflow2_field(q_size_field, size); ^ Change this one to use the correct field name to avoid the warning. Fixes: 5c629dc ("nvme: use struct group for generic command dwords") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 4ee7ffe commit a7de1de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/target/trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ TRACE_EVENT(nvmet_req_init,
9090
__entry->flags = cmd->common.flags;
9191
__entry->nsid = le32_to_cpu(cmd->common.nsid);
9292
__entry->metadata = le64_to_cpu(cmd->common.metadata);
93-
memcpy(__entry->cdw10, &cmd->common.cdw10,
93+
memcpy(__entry->cdw10, &cmd->common.cdws,
9494
sizeof(__entry->cdw10));
9595
),
9696
TP_printk("nvmet%s: %sqid=%d, cmdid=%u, nsid=%u, flags=%#x, "

0 commit comments

Comments
 (0)