diff options
author | Adam Ford <[email protected]> | 2020-07-16 07:26:20 -0500 |
---|---|---|
committer | Stephen Boyd <[email protected]> | 2020-07-22 18:47:57 -0700 |
commit | faf29338f3cb6ebcbff7297471b0fa56639a98bc (patch) | |
tree | 541acf178b9e84945d38217aa835f879bdaf2cd1 /lib/test_overflow.c | |
parent | 8200597fb16651e5b2280b694dd86352b738657b (diff) |
clk: vc5: Add memory check to prevent oops
When getting the names of the child nodes, kasprintf is used to
allocate memory which is used to create the string for the node
name. Unfortunately, there is no memory check to determine
if this allocation fails, it may cause an error when trying
to get child node name.
This patch will check if the memory allocation fails, and returns
and -ENOMEM error instead of blindly moving on.
Fixes: 260249f929e8 ("clk: vc5: Enable addition output configurations of the Versaclock")
Suggested-by: Dan Carpenter <[email protected]>
Signed-off-by: Adam Ford <[email protected]>
Reviewed-by: Luca Ceresoli <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Stephen Boyd <[email protected]>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions