Commit 2adafe55 authored by Eric Brower's avatar Eric Brower Committed by David S. Miller

SK98LIN: Fix oops in procfs handling if no cards probed.

parent 8549ccb7
......@@ -404,6 +404,7 @@ void proc_fill_inode(struct inode *inode, int fill)
*/
static int __init skge_probe (void)
{
int proc_root_initialized = 0;
int boards_found = 0;
int version_disp = 0;
SK_AC *pAC;
......@@ -429,11 +430,6 @@ static int __init skge_probe (void)
if (!pci_present()) /* is PCI support present? */
return -ENODEV;
pSkRootDir = create_proc_entry("sk98lin",
S_IFDIR | S_IWUSR | S_IRUGO | S_IXUGO, proc_net);
pSkRootDir->owner = THIS_MODULE;
while((pdev = pci_find_device(PCI_VENDOR_ID_SYSKONNECT,
PCI_DEVICE_ID_SYSKONNECT_GE, pdev)) != NULL) {
......@@ -485,6 +481,14 @@ static int __init skge_probe (void)
dev->do_ioctl = &SkGeIoctl;
dev->change_mtu = &SkGeChangeMtu;
if(!proc_root_initialized) {
pSkRootDir = create_proc_entry("sk98lin",
S_IFDIR | S_IWUSR | S_IRUGO | S_IXUGO, proc_net);
pSkRootDir->owner = THIS_MODULE;
proc_root_initialized = 1;
}
pProcFile = create_proc_entry(dev->name,
S_IFREG | 0444, pSkRootDir);
pProcFile->read_proc = proc_read;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment