diff options
author | Kai Ma <[email protected]> | 2023-04-18 11:34:51 +0000 |
---|---|---|
committer | Abel Vesa <[email protected]> | 2023-06-12 12:03:42 +0300 |
commit | 1b280598ab3bd8a2dc8b96a12530d5b1ee7a8f4a (patch) | |
tree | 64ecf3209b4ac138066be0cff5646852473045d2 /lib/memory-notifier-error-inject.c | |
parent | 8208181fe536bba3b411508f81c4426fc9c71d9a (diff) |
clk: imx: clk-imxrt1050: fix memory leak in imxrt1050_clocks_probe
Use devm_of_iomap() instead of of_iomap() to automatically
handle the unused ioremap region. If any error occurs, regions allocated by
kzalloc() will leak, but using devm_kzalloc() instead will automatically
free the memory using devm_kfree().
Also, fix error handling of hws by adding unregister_hws label, which
unregisters remaining hws when iomap failed.
Fixes: 7154b046d8f3 ("clk: imx: Add initial support for i.MXRT1050 clock driver")
Signed-off-by: Kai Ma <[email protected]>
Reviewed-by: Peng Fan <[email protected]>
Acked-by: Jesse Taube <[email protected]>
Reviewed-by: Abel Vesa <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Abel Vesa <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions