Skip to content

Commit 813c2f2

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: icp3-dtrace: Revert "Fix wrong kfree() usage"
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: 8c91ca7 ("ASoC: SOF: icp3-dtrace: Fix wrong kfree() usage") Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e3b3ec9 commit 813c2f2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sound/soc/sof/ipc3-dtrace.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ static int trace_filter_parse(struct snd_sof_dev *sdev, char *string,
137137
dev_err(sdev->dev,
138138
"Parsing filter entry '%s' failed with %d\n",
139139
entry, entry_len);
140-
kfree(*out);
141140
return -EINVAL;
142141
}
143142
}
@@ -209,13 +208,13 @@ static ssize_t dfsentry_trace_filter_write(struct file *file, const char __user
209208
ret = ipc3_trace_update_filter(sdev, num_elems, elems);
210209
if (ret < 0) {
211210
dev_err(sdev->dev, "Filter update failed: %d\n", ret);
212-
kfree(elems);
213211
goto error;
214212
}
215213
}
216214
ret = count;
217215
error:
218216
kfree(string);
217+
kfree(elems);
219218
return ret;
220219
}
221220

0 commit comments

Comments
 (0)