Skip to content

Commit

Permalink
cpcihp_generic: prevent loading without "bridge" parameter
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Greg Kroah-Hartman committed Oct 18, 2006
1 parent 29f3eb6 commit 49c61cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/hotplug/cpcihp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int __init validate_parameters(void)

if(!bridge) {
info("not configured, disabling.");
return 1;
return -EINVAL;
}
str = bridge;
if(!*str)
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 49c61cc

Please sign in to comment.