Skip to content
Commit faf29338 authored by Adam Ford's avatar Adam Ford Committed by Stephen Boyd
Browse files

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: 260249f9 ("clk: vc5: Enable addition output configurations of the Versaclock")

Suggested-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAdam Ford <aford173@gmail.com>
Reviewed-by: default avatarLuca Ceresoli <luca@lucaceresoli.net>
Link: https://lore.kernel.org/r/20200716122620.4538-1-aford173@gmail.com


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 8200597f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment