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]
Date:	Sun, 30 Sep 2012 18:28:26 +0800
From:	Axel Lin <axel.lin@...ics.com>
To:	Samuel Ortiz <sameo@...ux.intel.com>
Cc:	Matthias Kaehlcke <matthias@...hlcke.net>,
	Richard Purdie <rpurdie@...ys.net>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] backlight: tps65217_bl: Add missing platform_set_drvdata in
 tps65217_bl_probe

Otherwise, we got NULL derefernce while calling backlight_device_unregister()
in tps65217_bl_remove().

Also convert to use module_platform_driver.

Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
 drivers/video/backlight/tps65217_bl.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c
index 6ac2ef5..7088163 100644
--- a/drivers/video/backlight/tps65217_bl.c
+++ b/drivers/video/backlight/tps65217_bl.c
@@ -312,6 +312,7 @@ static int tps65217_bl_probe(struct platform_device *pdev)
 	}
 
 	tps65217_bl->bl->props.brightness = 0;
+	platform_set_drvdata(pdev, tps65217_bl);
 
 	return 0;
 }
@@ -334,18 +335,7 @@ static struct platform_driver tps65217_bl_driver = {
 	},
 };
 
-static int __init tps65217_bl_init(void)
-{
-	return platform_driver_register(&tps65217_bl_driver);
-}
-
-static void __exit tps65217_bl_exit(void)
-{
-	platform_driver_unregister(&tps65217_bl_driver);
-}
-
-module_init(tps65217_bl_init);
-module_exit(tps65217_bl_exit);
+module_platform_driver(tps65217_bl_driver);
 
 MODULE_DESCRIPTION("TPS65217 Backlight driver");
 MODULE_LICENSE("GPL v2");
-- 
1.7.9.5



--
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