Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: irq_helpers: duplicate IRQ name

The regulator IRQ helper requires caller to provide pointer to IRQ name
which is kept in memory by caller. All other data passed to the helper
in the regulator_irq_desc structure is copied. This can cause some
confusion and unnecessary complexity.

Make the regulator_irq_helper() to copy also the provided IRQ name
information so caller can discard the name after the call to
regulator_irq_helper() completes.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://msgid.link/r/ZhJMuUYwaZbBXFGP@drtxq0yyyyyyyyyyyyydy-3.rev.dnainternet.fi
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Matti Vaittinen and committed by
Mark Brown
7ab681dd fec50db7

+3
+3
drivers/regulator/irq_helpers.c
··· 352 352 353 353 h->irq = irq; 354 354 h->desc = *d; 355 + h->desc.name = devm_kstrdup(dev, d->name, GFP_KERNEL); 356 + if (!h->desc.name) 357 + return ERR_PTR(-ENOMEM); 355 358 356 359 ret = init_rdev_state(dev, h, rdev, common_errs, per_rdev_errs, 357 360 rdev_amount);