diff options
| author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2021-03-12 12:22:27 -0600 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2021-03-18 13:50:37 +0000 |
| commit | 157c4df677569daad6f204c63cfaf226c941bf03 (patch) | |
| tree | 1e920a5b7f0708a31f8d3249a92d5a61ebc3bda6 /scripts/gdb/linux/tasks.py | |
| parent | 5b349c8f355ae4bd1de462f1f1b6164d14796b0e (diff) | |
ASoC: cros_ec_codec: remove null pointer dereference warning
Cppcheck complains of a possible issue:
sound/soc/codecs/cros_ec_codec.c:98:10: warning: Possible null pointer
dereference: in [nullPointer]
memcpy(in, msg->data, insize);
^
sound/soc/codecs/cros_ec_codec.c:162:34: note: Calling function
'send_ec_host_command', 5th argument 'NULL' value is 0
(uint8_t *)&p, sizeof(p), NULL, 0);
^
sound/soc/codecs/cros_ec_codec.c:98:10: note: Null pointer dereference
memcpy(in, msg->data, insize);
^
In practice the access to the pointer is protected by another
argument, but this is likely to fool other static analysis tools. Add
a test to avoid doing the memcpy if the pointer is NULL or the size is
zero.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210312182246.5153-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'scripts/gdb/linux/tasks.py')
0 files changed, 0 insertions, 0 deletions
