video: fbdev: grvga.c: Fix for possible null pointer dereference

There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
Rickard Strandqvist 2014-05-20 23:35:59 +02:00 committed by Tomi Valkeinen
parent 972754cfae
commit d9a5f87c8f

View File

@ -514,9 +514,10 @@ static int grvga_probe(struct platform_device *dev)
static int grvga_remove(struct platform_device *device)
{
struct fb_info *info = dev_get_drvdata(&device->dev);
struct grvga_par *par = info->par;
struct grvga_par *par;
if (info) {
par = info->par;
unregister_framebuffer(info);
fb_dealloc_cmap(&info->cmap);