diff options
author | Kunwu Chan <chentao@kylinos.cn> | 2024-01-18 13:42:57 +0800 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2024-02-14 10:26:11 +0100 |
commit | 5d7f58ee08434a33340f75ac7ac5071eea9673b3 (patch) | |
tree | 63e4fa5aac5a671e1cbfc99336a46ac5451815f5 /drivers/pmdomain | |
parent | e990f3fb926367f67ab3c2310997864f82a0dcd5 (diff) |
pmdomain: ti: Add a null pointer check to the omap_prm_domain_init
devm_kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure. Ensure the allocation was successful
by checking the pointer validity.
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20240118054257.200814-1-chentao@kylinos.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/pmdomain')
-rw-r--r-- | drivers/pmdomain/ti/omap_prm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pmdomain/ti/omap_prm.c b/drivers/pmdomain/ti/omap_prm.c index c2feae3a634c..b8ceb3c2b81c 100644 --- a/drivers/pmdomain/ti/omap_prm.c +++ b/drivers/pmdomain/ti/omap_prm.c @@ -695,6 +695,8 @@ static int omap_prm_domain_init(struct device *dev, struct omap_prm *prm) data = prm->data; name = devm_kasprintf(dev, GFP_KERNEL, "prm_%s", data->name); + if (!name) + return -ENOMEM; prmd->dev = dev; prmd->prm = prm; |