Skip to content

Commit 1315848

Browse files
elfringthierryreding
authored andcommitted
firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()
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 <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 6613476 commit 1315848

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/tegra/bpmp-debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static const char *get_filename(struct tegra_bpmp *bpmp,
7777

7878
root_path_buf = kzalloc(root_path_buf_len, GFP_KERNEL);
7979
if (!root_path_buf)
80-
goto out;
80+
return NULL;
8181

8282
root_path = dentry_path(bpmp->debugfs_mirror, root_path_buf,
8383
root_path_buf_len);

0 commit comments

Comments
 (0)