firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()
[ Upstream commit 1315848f1f
]
The kfree() function was called in one case by
the get_filename() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.
Thus return directly after a call of the function “kzalloc” failed
at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8af60bb2b2
commit
161d6b8037
@ -81,7 +81,7 @@ static const char *get_filename(struct tegra_bpmp *bpmp,
|
|||||||
|
|
||||||
root_path_buf = kzalloc(root_path_buf_len, GFP_KERNEL);
|
root_path_buf = kzalloc(root_path_buf_len, GFP_KERNEL);
|
||||||
if (!root_path_buf)
|
if (!root_path_buf)
|
||||||
goto out;
|
return NULL;
|
||||||
|
|
||||||
root_path = dentry_path(bpmp->debugfs_mirror, root_path_buf,
|
root_path = dentry_path(bpmp->debugfs_mirror, root_path_buf,
|
||||||
root_path_buf_len);
|
root_path_buf_len);
|
||||||
|
Reference in New Issue
Block a user