This seems to be a copy-paste left-over from of_overlay_filter_filename, which has some actual use for both p and path. We don't though and just end up leaking the buffer, so drop these variables. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- drivers/of/overlay.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 20a43f5170c8..fff1d6ea028e 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -418,7 +418,6 @@ void of_overlay_set_basedir(const char *path) static int of_overlay_apply_dir(struct device_node *root, const char *dirname, bool filter) { - char *p, *path; int ret = 0; DIR *dir; @@ -431,8 +430,6 @@ static int of_overlay_apply_dir(struct device_node *root, const char *dirname, if (!dir) return -errno; - p = path = strdup(of_overlay_filepattern); - while (1) { struct dirent *ent; char *filename; -- 2.30.2