From: Dan Carpenter Date: Mon, 16 Dec 2013 09:49:23 +0000 (+0300) Subject: tgafb: potential NULL dereference in init X-Git-Tag: v4.14-rc1~8199^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ede5804ca3b42c831f7440ec29bc7187e5376bb;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c index 5e94c6e4..07c7df9 100644 --- a/drivers/video/tgafb.c +++ b/drivers/video/tgafb.c @@ -1490,10 +1490,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));