mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
The kasprintf() function returns NULL on memory allocation failure, but
the code in plt_clk_register() was not checking this return value. If
kasprintf fails, init.name would be NULL and could cause NULL pointer
dereference when clkdev_hw_create() uses it.
Add proper error checking for the kasprintf() return value and return
ERR_PTR(-ENOMEM) on failure.
Fixes: 1141d9d081 ("clk: x86: Add Atom PMC platform clocks")
Signed-off-by: longlong yan <[email protected]>
Reviewed-by: Brian Masney <[email protected]>
Signed-off-by: Brian Masney <[email protected]>