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-next>] [day] [month] [year] [list]
Message-Id: <1221420753-6613-1-git-send-email-ukleinek@informatik.uni-freiburg.de>
Date:	Sun, 14 Sep 2008 21:32:33 +0200
From:	Uwe Kleine-König 
	<ukleinek@...ormatik.uni-freiburg.de>
To:	linux-kernel@...r.kernel.org
Cc:	Adrian McMenamin <adrian@...en.demon.co.uk>,
	Paul Mundt <lethal@...ux-sh.org>, Takashi Iwai <tiwai@...e.de>,
	Jaroslav Kysela <perex@...ex.cz>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] Fix section for snd-aica platform driver

Don't use __init but __devinit to define probe function.  A pointer to
snd_aica_probe is passed to the core via platform_driver_register and so the
function must not disappear after the module is loaded.  Using __init
and having HOTPLUG=y and SND_AICA=m the following probably oopses:

	echo -n AICA > /sys/bus/platform/driver/AICA/unbind
	echo -n AICA > /sys/bus/platform/driver/AICA/bind

Strange enough add_aicamixer_controls which is only called by
snd_aica_probe was already using __devinit.

While at it move the remove function to .devexit.text section.

Signed-off-by: Uwe Kleine-König <ukleinek@...ormatik.uni-freiburg.de>
Cc: Adrian McMenamin <adrian@...en.demon.co.uk>
Cc: Paul Mundt <lethal@...ux-sh.org>
Cc: Takashi Iwai <tiwai@...e.de>
Cc: Jaroslav Kysela <perex@...ex.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>

---
 sound/sh/aica.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index 54df8ba..8cdf71a 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -589,7 +589,7 @@ static int __devinit add_aicamixer_controls(struct snd_card_aica
 	return 0;
 }
 
-static int snd_aica_remove(struct platform_device *devptr)
+static int __devexit snd_aica_remove(struct platform_device *devptr)
 {
 	struct snd_card_aica *dreamcastcard;
 	dreamcastcard = platform_get_drvdata(devptr);
@@ -601,7 +601,7 @@ static int snd_aica_remove(struct platform_device *devptr)
 	return 0;
 }
 
-static int __init snd_aica_probe(struct platform_device *devptr)
+static int __devinit snd_aica_probe(struct platform_device *devptr)
 {
 	int err;
 	struct snd_card_aica *dreamcastcard;
@@ -650,7 +650,7 @@ static int __init snd_aica_probe(struct platform_device *devptr)
 
 static struct platform_driver snd_aica_driver = {
 	.probe = snd_aica_probe,
-	.remove = snd_aica_remove,
+	.remove = __devexit_p(snd_aica_remove),
 	.driver = {
 		   .name = SND_AICA_DRIVER},
 };
-- 
tg: (6bfb09a..) t/sectionfixes/snd_aica (depends on: linus/master)
--
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