aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2010-04-17 15:44:56 -0400
committerJonathan Corbet <corbet@lwn.net>2010-05-07 19:17:39 -0400
commit2fed547c0298e1465d62b34a75a7b76353fee7d3 (patch)
tree45e543683599fbb6460b458877db08e31e7a16d5 /drivers/video/via
parent162fc8c0c03d5b8536f14cbd2cdfb399c50c05ec (diff)
viafb: fix proc entry removal
viafb: fix proc entry removal Trying to remove unregistered proc entries became painful and is useless anyway. So remove the removal of an entry that was never registered and duplicate the logic for one which is added conditionally. Additionally move the removal above releasing fb_info as we still need the information. This prevents tainting the kernel by the procfs warn on and avoiding access to already freed memory is probably also a good idea. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/via')
-rw-r--r--drivers/video/via/viafbdev.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index e94f913f87be..51e9106138ce 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1702,13 +1702,16 @@ static void viafb_init_proc(struct proc_dir_entry **viafb_entry)
1702} 1702}
1703static void viafb_remove_proc(struct proc_dir_entry *viafb_entry) 1703static void viafb_remove_proc(struct proc_dir_entry *viafb_entry)
1704{ 1704{
1705 /* no problem if it was not registered */ 1705 struct chip_information *chip_info = &viaparinfo->shared->chip_info;
1706
1706 remove_proc_entry("dvp0", viafb_entry);/* parent dir */ 1707 remove_proc_entry("dvp0", viafb_entry);/* parent dir */
1707 remove_proc_entry("dvp1", viafb_entry); 1708 remove_proc_entry("dvp1", viafb_entry);
1708 remove_proc_entry("dfph", viafb_entry); 1709 remove_proc_entry("dfph", viafb_entry);
1709 remove_proc_entry("dfpl", viafb_entry); 1710 remove_proc_entry("dfpl", viafb_entry);
1710 remove_proc_entry("vt1636", viafb_entry); 1711 if (chip_info->lvds_chip_info.lvds_chip_name == VT1636_LVDS
1711 remove_proc_entry("vt1625", viafb_entry); 1712 || chip_info->lvds_chip_info2.lvds_chip_name == VT1636_LVDS)
1713 remove_proc_entry("vt1636", viafb_entry);
1714
1712 remove_proc_entry("viafb", NULL); 1715 remove_proc_entry("viafb", NULL);
1713} 1716}
1714 1717
@@ -1967,12 +1970,10 @@ void __devexit via_fb_pci_remove(struct pci_dev *pdev)
1967 unregister_framebuffer(viafbinfo); 1970 unregister_framebuffer(viafbinfo);
1968 if (viafb_dual_fb) 1971 if (viafb_dual_fb)
1969 unregister_framebuffer(viafbinfo1); 1972 unregister_framebuffer(viafbinfo1);
1970 1973 viafb_remove_proc(viaparinfo->shared->proc_entry);
1971 framebuffer_release(viafbinfo); 1974 framebuffer_release(viafbinfo);
1972 if (viafb_dual_fb) 1975 if (viafb_dual_fb)
1973 framebuffer_release(viafbinfo1); 1976 framebuffer_release(viafbinfo1);
1974
1975 viafb_remove_proc(viaparinfo->shared->proc_entry);
1976} 1977}
1977 1978
1978#ifndef MODULE 1979#ifndef MODULE