lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 2 Apr 2014 17:04:38 +0100 From: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com> To: Mark Brown <broonie@...nel.org> Cc: lgirdwood@...il.com, linux-kernel@...r.kernel.org, patches@...nsource.wolfsonmicro.com Subject: Re: [PATCH] regulator: core: Get and put regulator of_node On Wed, Apr 02, 2014 at 03:23:56PM +0100, Mark Brown wrote: > On Wed, Apr 02, 2014 at 03:06:54PM +0100, Charles Keepax wrote: > > > We should be incrementing the reference count of the of_node for the > > regulator when we take a copy of it. This patch does so. > > Why? > > Note that in any case this is going to have absolutely no impact on > practical systems since everything using regulators uses FDT at the > minute. Apologies I must be missing something, take for example the fixed regulator driver (fixed.c). We get an of_node from pdev->dev->of_node, pull the init_data from it, then copy the of_node into the regulator_config and call regulator_register. regulator_register will copy the of_node from the regulator_config and put it into the new device, but as far as I can see no one ever incremented the reference count? of_node = pdev->dev.of_node; drvdata->dev = regulator_register(&drvdata->desc, &cfg); Looks like there are a couple of other regulator drivers in the same boat. Just seems easier to let the core do the reference stuff rather than needing to do it in the drivers. Thanks, Charles -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists