linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]video:uvesafb: Fix dereference NULL pointer code path
@ 2013-01-27  6:13 Wang YanQing
  0 siblings, 0 replies; 3+ messages in thread
From: Wang YanQing @ 2013-01-27  6:13 UTC (permalink / raw)
  To: FlorianSchandinat; +Cc: spock, linux-fbdev, linux-kernel

platform_device_alloc could failed and return NULL,
we should check this before call platform_device_put.

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/uvesafb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 2f8f82d..230bd45 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -1975,7 +1975,8 @@ static int __devinit uvesafb_init(void)
 			err = -ENOMEM;
 
 		if (err) {
-			platform_device_put(uvesafb_device);
+			if (uvesafb_device)
+				platform_device_put(uvesafb_device);
 			platform_driver_unregister(&uvesafb_driver);
 			cn_del_callback(&uvesafb_cn_id);
 			return err;
-- 
1.7.11.1.116.g8228a23

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH]video:uvesafb: Fix dereference NULL pointer code path
@ 2013-03-30  2:53 Wang YanQing
  2013-04-02 10:34 ` Tomi Valkeinen
  0 siblings, 1 reply; 3+ messages in thread
From: Wang YanQing @ 2013-03-30  2:53 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: spock, linux-fbdev, FlorianSchandinat, linux-kernel

platform_device_alloc could failed and return NULL,
we should check this before call platform_device_put.

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/uvesafb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 2f8f82d..230bd45 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -1975,7 +1975,8 @@ static int __devinit uvesafb_init(void)
 			err = -ENOMEM;
 
 		if (err) {
-			platform_device_put(uvesafb_device);
+			if (uvesafb_device)
+				platform_device_put(uvesafb_device);
 			platform_driver_unregister(&uvesafb_driver);
 			cn_del_callback(&uvesafb_cn_id);
 			return err;
-- 
1.7.11.1.116.g8228a23

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-02 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-27  6:13 [PATCH]video:uvesafb: Fix dereference NULL pointer code path Wang YanQing
  -- strict thread matches above, loose matches on Subject: below --
2013-03-30  2:53 Wang YanQing
2013-04-02 10:34 ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).