diff options
author | Arnd Bergmann <[email protected]> | 2017-01-24 15:17:56 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2017-01-24 16:26:14 -0800 |
commit | de182cc8e882f74af2a112e09f148ce646937232 (patch) | |
tree | 08d50362a81f1a786d94bec135ea3457ed57965d /lib/test-string_helpers.c | |
parent | b94f51183b0617e7b9b4fb4137d4cf1cab7547c2 (diff) |
drivers/memstick/core/memstick.c: avoid -Wnonnull warning
gcc-7 produces a harmless false-postive warning about a possible NULL
pointer access:
drivers/memstick/core/memstick.c: In function 'h_memstick_read_dev_id':
drivers/memstick/core/memstick.c:309:3: error: argument 2 null where non-null expected [-Werror=nonnull]
memcpy(mrq->data, buf, mrq->data_len);
This can't happen because the caller sets the command to 'MS_TPC_READ_REG',
which causes the data direction to be 'READ' and the NULL pointer not
accessed.
As a simple workaround for the warning, we can pass a pointer to the
data that we actually want to read into. This is not needed here, but
also harmless, and lets the compiler know that the access is ok.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
Cc: Alex Dubov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions