Skip to content

Commit

Permalink
fbdev: sh_mobile_hdmi: properly clean up modedb on monitor unplug
Browse files Browse the repository at this point in the history
Even though this is not a problem currently, it is better to clear the freed
pointer and nullify the length of the freed memory.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Guennadi Liakhovetski authored and Paul Mundt committed Nov 10, 2010
1 parent a7bcf21 commit 91d63f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/video/sh_mobile_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,14 +1071,17 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
if (!hdmi->info)
goto out;

hdmi->monspec.modedb_len = 0;
fb_destroy_modedb(hdmi->monspec.modedb);
hdmi->monspec.modedb = NULL;

acquire_console_sem();

/* HDMI disconnect */
fb_set_suspend(hdmi->info, 1);

release_console_sem();
pm_runtime_put(hdmi->dev);
fb_destroy_modedb(hdmi->monspec.modedb);
}

out:
Expand Down

0 comments on commit 91d63f8

Please sign in to comment.