The "id" comes from the user. Change the type to unsigned to prevent
an array underflow.
Fixes:
f4ea22f7aa75 ("ASoC: SOF: ipc4: Add support for mtrace log extraction")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/Y8laruWOEwOC/dx9@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
size_t count, loff_t *ppos)
{
struct sof_mtrace_priv *priv = file->private_data;
size_t count, loff_t *ppos)
{
struct sof_mtrace_priv *priv = file->private_data;
/*
* To update Nth mask entry, write:
/*
* To update Nth mask entry, write:
if (IS_ERR(buf))
return PTR_ERR(buf);
if (IS_ERR(buf))
return PTR_ERR(buf);
- ret = sscanf(buf, "%d,0x%x", &id, &mask);
+ ret = sscanf(buf, "%u,0x%x", &id, &mask);
- ret = sscanf(buf, "%d,%x", &id, &mask);
+ ret = sscanf(buf, "%u,%x", &id, &mask);
if (ret != 2) {
ret = -EINVAL;
goto out;
if (ret != 2) {
ret = -EINVAL;
goto out;