projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3b3ec9
)
ASoC: SOF: icp3-dtrace: Revert "Fix wrong kfree() usage"
author
Peter Ujfalusi
<peter.ujfalusi@linux.intel.com>
Fri, 12 Jan 2024 13:27:49 +0000
(15:27 +0200)
committer
Mark Brown
<broonie@kernel.org>
Fri, 12 Jan 2024 14:13:52 +0000
(14:13 +0000)
The offending patch introduces memory leak when there is no error, the
memory allocated for the temporary storage is not freed up.
As I have commented, the original code was correct and cleaner to
follow but it was not obvious from the patch that it will introduce
regression.
Fixes: 8c91ca76f448 ("ASoC: SOF: icp3-dtrace: Fix wrong kfree() usage")
Link:
https://lore.kernel.org/all/aec61f67-6b4f-49e6-b458-c332983a0ad6@linux.intel.com/
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link:
https://msgid.link/r/20240112132749.28970-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc3-dtrace.c
patch
|
blob
|
history
diff --git
a/sound/soc/sof/ipc3-dtrace.c
b/sound/soc/sof/ipc3-dtrace.c
index 93b189c2d2ee2f8886e8c1cbbc52100ea2c2be72..0dca139322f3d22a14c7f6d45a9a343090a9f2bb 100644
(file)
--- a/
sound/soc/sof/ipc3-dtrace.c
+++ b/
sound/soc/sof/ipc3-dtrace.c
@@
-137,7
+137,6
@@
static int trace_filter_parse(struct snd_sof_dev *sdev, char *string,
dev_err(sdev->dev,
"Parsing filter entry '%s' failed with %d\n",
entry, entry_len);
- kfree(*out);
return -EINVAL;
}
}
@@
-209,13
+208,13
@@
static ssize_t dfsentry_trace_filter_write(struct file *file, const char __user
ret = ipc3_trace_update_filter(sdev, num_elems, elems);
if (ret < 0) {
dev_err(sdev->dev, "Filter update failed: %d\n", ret);
- kfree(elems);
goto error;
}
}
ret = count;
error:
kfree(string);
+ kfree(elems);
return ret;
}