Skip to content

Commit

Permalink
video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
Browse files Browse the repository at this point in the history
Because uvesafb_par is allocated as part of fb_info in uvesafb_probe,
so we don't need to do NULL check for both fb_info and uvesafb_par in
uvesafb_remove.

[ This patch also fix a warning report by [email protected]
  "drivers/video/fbdev/uvesafb.c:1815 uvesafb_remove()
   warn: variable dereferenced before check 'par'" ]

Signed-off-by: Wang YanQing <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
  • Loading branch information
wyqkp authored and tomba committed Mar 6, 2014
1 parent 2925b0d commit a57aa93
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/video/uvesafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1812,11 +1812,9 @@ static int uvesafb_remove(struct platform_device *dev)
fb_destroy_modedb(info->monspecs.modedb);
fb_dealloc_cmap(&info->cmap);

if (par) {
kfree(par->vbe_modes);
kfree(par->vbe_state_orig);
kfree(par->vbe_state_saved);
}
kfree(par->vbe_modes);
kfree(par->vbe_state_orig);
kfree(par->vbe_state_saved);

framebuffer_release(info);
}
Expand Down

0 comments on commit a57aa93

Please sign in to comment.