mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
clk: versaclock: return value calculated by ERR_PTR
In versaclock_get_name -ENOMEM is passed to ERR_PTR but nothing is done with the value that this calculates which is obviously not the intention of the code. This is confirmed by the code around where this function is called. Instead return the value from ERR_PTR. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
This commit is contained in:
committed by
Tom Rini
parent
bd0ade7d09
commit
6f48f6f2a2
@@ -850,7 +850,7 @@ static char *versaclock_get_name(const char *dev_name, const char *clk_name, int
|
||||
|
||||
buf = malloc(length);
|
||||
if (!buf)
|
||||
ERR_PTR(-ENOMEM);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
if (index < 0)
|
||||
snprintf(buf, length, "%s.%s", dev_name, clk_name);
|
||||
|
||||
Reference in New Issue
Block a user