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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Prayer.1.3.4.1109052203150.9756@hermes-2.csi.cam.ac.uk>
Date:	05 Sep 2011 22:03:15 +0100
From:	"J.I. Cameron" <jic23@....ac.uk>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	linux-kernel@...r.kernel.org, patches@...nsource.wolfsonmicro.com
Subject: Re: [PATCH 1/3] regmap: Remove bitrotted module_put()s

On Sep 5 2011, Mark Brown wrote:

>The conversion to per bus type registration functions means we don't need
>to do module_get()s to hold the bus types in memory (their users will link
>to them) so we removed all those calls. This left module_put() calls in
>the cleanup paths which aren't needed and which cause unbalanced puts if
>we ever try to unload anything.
>
Thanks Mark, all three look good to me.  Thanks also for your comments
on my driver changes, I'll clean it up and repost tomorrow.

>Reported-by: Jonathan Cameron <jic23@....ac.uk>
>Signed-off-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>

> drivers/base/regmap/regmap.c |    5 +----
> 1 files changed, 1 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
>index fa2bd89..86b1847 100644
>--- a/drivers/base/regmap/regmap.c
>+++ b/drivers/base/regmap/regmap.c
>@@ -198,15 +198,13 @@ struct regmap *regmap_init(struct device *dev,
> 	map->work_buf = kmalloc(map->format.buf_size, GFP_KERNEL);
> 	if (map->work_buf == NULL) {
> 		ret = -ENOMEM;
>-		goto err_bus;
>+		goto err_map;
> 	}
> 
> 	regmap_debugfs_init(map);
> 
> 	return map;
> 
>-err_bus:
>-	module_put(map->bus->owner);
> err_map:
> 	kfree(map);
> err:
>@@ -221,7 +219,6 @@ void regmap_exit(struct regmap *map)
> {
> 	regmap_debugfs_exit(map);
> 	kfree(map->work_buf);
>-	module_put(map->bus->owner);
> 	kfree(map);
> }
> EXPORT_SYMBOL_GPL(regmap_exit);
>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ