1
0
Fork 0

fbdev: sh_mobile_hdmi: properly clean up modedb on monitor unplug

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>
hifive-unleashed-5.1
Guennadi Liakhovetski 2010-11-04 11:05:55 +00:00 committed by Paul Mundt
parent a7bcf21e60
commit 91d63f8a30
1 changed files with 4 additions and 1 deletions

View File

@ -1071,6 +1071,10 @@ 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 */
@ -1078,7 +1082,6 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
release_console_sem();
pm_runtime_put(hdmi->dev);
fb_destroy_modedb(hdmi->monspec.modedb);
}
out: