Commit a86c9e65 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Fix return code of init_module in drivers_net_arlan.c (2)

From:  Pablo Menichini <pablo@menichini.com.ar>

  	This patch returns correct error codes if init_modules fail.
  Because of this, we can take the printks indicating the error as these
  corrected error codes return miningfull information.
parent 0d025c6b
...@@ -2014,32 +2014,24 @@ int init_module(void) ...@@ -2014,32 +2014,24 @@ int init_module(void)
ARLAN_DEBUG_ENTRY("init_module"); ARLAN_DEBUG_ENTRY("init_module");
if (channelSet != channelSetUNKNOWN || channelNumber != channelNumberUNKNOWN || systemId != systemIdUNKNOWN) if (channelSet != channelSetUNKNOWN || channelNumber != channelNumberUNKNOWN || systemId != systemIdUNKNOWN)
{ return -EINVAL;
printk(KERN_WARNING "arlan: wrong module params for multiple devices\n ");
return -1;
}
numDevices = arlan_find_devices(); numDevices = arlan_find_devices();
if (numDevices == 0) if (numDevices == 0)
{ return -ENODEV;
printk(KERN_ERR "arlan: no devices found \n");
return -1;
}
siteName = kmalloc(100, GFP_KERNEL); siteName = kmalloc(100, GFP_KERNEL);
if(siteName==NULL) if(siteName==NULL)
{ return -ENOMEM;
printk(KERN_ERR "arlan: No memory for site name.\n");
return -1;
}
for (i = 0; i < numDevices && i < MAX_ARLANS; i++) for (i = 0; i < numDevices && i < MAX_ARLANS; i++)
{ {
if (!arlan_allocate_device(i, NULL)) if (!arlan_allocate_device(i, NULL))
return -1; return -ENOMEM;
if (arlan_device[i] == NULL) if (arlan_device[i] == NULL)
{ return -ENOMEM;
printk(KERN_CRIT "arlan: Not Enough memory \n");
return -1;
}
if (probe) if (probe)
arlan_probe_everywhere(arlan_device[i]); arlan_probe_everywhere(arlan_device[i]);
// arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); // arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN );
......
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