From a86c9e65b4f236f5383c39bd6202d610482fb266 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 9 Feb 2003 02:59:46 -0800 Subject: [PATCH] [PATCH] Fix return code of init_module in drivers_net_arlan.c (2) From: Pablo Menichini 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. --- drivers/net/arlan.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/net/arlan.c b/drivers/net/arlan.c index 8911e8b3af71e..4c25abbc450af 100644 --- a/drivers/net/arlan.c +++ b/drivers/net/arlan.c @@ -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 ); -- 2.53.0