From akinobu.mita@gmail.com Fri Oct 13 11:07:04 2006 Date: Sat, 14 Oct 2006 03:07:30 +0900 From: Akinobu Mita To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Scott Murray Subject: cpcihp_generic: prevent loading without "bridge" parameter Message-ID: <20061013180730.GE29079@localhost> Content-Disposition: inline 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 Signed-off-by: Scott Murray Signed-off-by: Greg Kroah-Hartman --- drivers/pci/hotplug/cpcihp_generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- gregkh-2.6.orig/drivers/pci/hotplug/cpcihp_generic.c +++ gregkh-2.6/drivers/pci/hotplug/cpcihp_generic.c @@ -84,7 +84,7 @@ static int __init validate_parameters(vo if(!bridge) { info("not configured, disabling."); - return 1; + return -EINVAL; } str = bridge; if(!*str) @@ -147,7 +147,7 @@ static int __init cpcihp_generic_init(vo 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");