[3.11.y.z extended stable] Patch "tgafb: potential NULL dereference in init" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Apr 21 09:27:07 UTC 2014


This is a note to let you know that I have just added a patch titled

    tgafb: potential NULL dereference in init

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 254847cbee2d69aa707354df0809e39fdc07419c Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter at oracle.com>
Date: Mon, 16 Dec 2013 12:49:23 +0300
Subject: tgafb: potential NULL dereference in init

commit 0ede5804ca3b42c831f7440ec29bc7187e5376bb upstream.

Static checkers complain that there are paths where "tga_type_name" can
be NULL.  I've re-arranged the code slightly so that's impossible.

Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ti.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/video/tgafb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c
index c9c8e5a..ef894b3 100644
--- a/drivers/video/tgafb.c
+++ b/drivers/video/tgafb.c
@@ -1496,10 +1496,9 @@ tgafb_init_fix(struct fb_info *info)
 		if (tga_bus_tc)
 			tga_type_name = "Digital ZLX-E3";
 		break;
-	default:
-		tga_type_name = "Unknown";
-		break;
 	}
+	if (!tga_type_name)
+		tga_type_name = "Unknown";

 	strlcpy(info->fix.id, tga_type_name, sizeof(info->fix.id));

--
1.9.1





More information about the kernel-team mailing list