Commit 825906f2 authored by Kunwu Chan's avatar Kunwu Chan Committed by Lee Jones

mfd: tps6594: Add null pointer check to tps6594_device_init()

devm_kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: 325bec71 ("mfd: tps6594: Add driver for TI TPS6594 PMIC")
Suggested-by: default avatarLee Jones <lee@kernel.org>
Signed-off-by: default avatarKunwu Chan <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20231208033320.49345-1-chentao@kylinos.cnSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 4f9b632e
......@@ -433,6 +433,9 @@ int tps6594_device_init(struct tps6594 *tps, bool enable_crc)
tps6594_irq_chip.name = devm_kasprintf(dev, GFP_KERNEL, "%s-%ld-0x%02x",
dev->driver->name, tps->chip_id, tps->reg);
if (!tps6594_irq_chip.name)
return -ENOMEM;
ret = devm_regmap_add_irq_chip(dev, tps->regmap, tps->irq, IRQF_SHARED | IRQF_ONESHOT,
0, &tps6594_irq_chip, &tps->irq_data);
if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment