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)
ARLAN_DEBUG_ENTRY("init_module");
if (channelSet != channelSetUNKNOWN || channelNumber != channelNumberUNKNOWN || systemId != systemIdUNKNOWN)
{
printk(KERN_WARNING "arlan: wrong module params for multiple devices\n ");
return -1;
}
return -EINVAL;
numDevices = arlan_find_devices();
if (numDevices == 0)
{
printk(KERN_ERR "arlan: no devices found \n");
return -1;
}
return -ENODEV;
siteName = kmalloc(100, GFP_KERNEL);
if(siteName==NULL)
{
printk(KERN_ERR "arlan: No memory for site name.\n");
return -1;
}
return -ENOMEM;
for (i = 0; i < numDevices && i < MAX_ARLANS; i++)
{
if (!arlan_allocate_device(i, NULL))
return -1;
return -ENOMEM;
if (arlan_device[i] == NULL)
{
printk(KERN_CRIT "arlan: Not Enough memory \n");
return -1;
}
return -ENOMEM;
if (probe)
arlan_probe_everywhere(arlan_device[i]);
// 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