autoconfig: don't call closedir() when opendir() failed
If opendir() fails, return from matchDriverFromFiles() immediately. Ubuntu bug 217647.
This commit is contained in:
parent
76381092e8
commit
fbad87f2ae
|
@ -330,7 +330,9 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
idsdir = opendir(PCI_TXT_IDS_PATH);
|
idsdir = opendir(PCI_TXT_IDS_PATH);
|
||||||
if (idsdir) {
|
if (!idsdir)
|
||||||
|
return;
|
||||||
|
|
||||||
xf86Msg(X_INFO, "Scanning %s directory for additional PCI ID's supported by the drivers\n", PCI_TXT_IDS_PATH);
|
xf86Msg(X_INFO, "Scanning %s directory for additional PCI ID's supported by the drivers\n", PCI_TXT_IDS_PATH);
|
||||||
direntry = readdir(idsdir);
|
direntry = readdir(idsdir);
|
||||||
/* Read the directory */
|
/* Read the directory */
|
||||||
|
@ -408,7 +410,6 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip
|
||||||
}
|
}
|
||||||
direntry = readdir(idsdir);
|
direntry = readdir(idsdir);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
end:
|
end:
|
||||||
xfree(line);
|
xfree(line);
|
||||||
closedir(idsdir);
|
closedir(idsdir);
|
||||||
|
|
Loading…
Reference in New Issue