aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-12-16 04:49:23 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-01-17 03:57:48 -0500
commit0ede5804ca3b42c831f7440ec29bc7187e5376bb (patch)
tree6760c9fd0cda38527f4d237d2e5125befff5e25a /drivers/video
parent6fc19c40be96df73d81d8123e31fe45c16c6c2b6 (diff)
tgafb: potential NULL dereference in init
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@oracle.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/tgafb.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c
index 5e94c6e4f682..07c7df9ee77b 100644
--- a/drivers/video/tgafb.c
+++ b/drivers/video/tgafb.c
@@ -1490,10 +1490,9 @@ tgafb_init_fix(struct fb_info *info)
1490 if (tga_bus_tc) 1490 if (tga_bus_tc)
1491 tga_type_name = "Digital ZLX-E3"; 1491 tga_type_name = "Digital ZLX-E3";
1492 break; 1492 break;
1493 default:
1494 tga_type_name = "Unknown";
1495 break;
1496 } 1493 }
1494 if (!tga_type_name)
1495 tga_type_name = "Unknown";
1497 1496
1498 strlcpy(info->fix.id, tga_type_name, sizeof(info->fix.id)); 1497 strlcpy(info->fix.id, tga_type_name, sizeof(info->fix.id));
1499 1498