]> err.no Git - linux-2.6/commitdiff
cpcihp_generic: prevent loading without "bridge" parameter
authorAkinobu Mita <akinobu.mita@gmail.com>
Fri, 13 Oct 2006 18:07:30 +0000 (03:07 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 18 Oct 2006 18:36:12 +0000 (11:36 -0700)
cpcihp_generic module requires configured "bridge" module parameter.
But it can be loaded successfully without that parameter.
Because module init call ends up returning positive value.

This patch prevents from loading without setting "bridge" module parameter.

Signed-off-by: Akinbou Mita <akinobu.mita@gmail.com>
Signed-off-by: Scott Murray <scottm@somanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/cpcihp_generic.c

index e847f0d6c7fea74dd00e3a757a7c2ea8b4e2d159..f3852a6b74eada8b19bc732faf27b383897a9075 100644 (file)
@@ -84,7 +84,7 @@ static int __init validate_parameters(void)
 
        if(!bridge) {
                info("not configured, disabling.");
-               return 1;
+               return -EINVAL;
        }
        str = bridge;
        if(!*str)
@@ -147,7 +147,7 @@ static int __init cpcihp_generic_init(void)
 
        info(DRIVER_DESC " version: " DRIVER_VERSION);
        status = validate_parameters();
-       if(status != 0)
+       if (status)
                return status;
 
        r = request_region(port, 1, "#ENUM hotswap signal register");