cpcihp_generic: prevent loading without "bridge" parameter
Subsystems (2)
PATCH 1/1 cpcihp_generic: prevent loading without "bridge" parameter
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.
Cc Greg Kroah-Hartman <[email protected]>
Cc Scott Murray <[email protected]>
Signed-off-by Akinbou Mita <[email protected]>
drivers/pci/hotplug/cpcihp_generic.c +2 -2
@@ -84,7 +84,7 @@ static int __init validate_parameters(voif (!bridge) {info ("not configured, disabling." ); -return 1 ; +return -EINVAL ; } str = bridge;if (!*str)
@@ -147,7 +147,7 @@ static int __init cpcihp_generic_init(voinfo (DRIVER_DESC " version: " DRIVER_VERSION ); status =validate_parameters (); -if (status !=0 ) +if (status)return status; r =request_region (port,1 ,"#ENUM hotswap signal register" );
Quoted 9 lines · Akinobu Mita
cpcihp_genericmodule 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.
Cc Greg Kroah-Hartman <[email protected]>Cc Scott Murray <[email protected]>Signed-off-by Akinbou Mita <[email protected]>
Signed-off-by Scott Murray <[email protected]>
Quoted 22 lines
Index:
work-fault-inject/drivers/pci/hotplug/cpcihp_generic.c
===================================================================drivers/pci/hotplug/cpcihp_generic.c +2
-2@@ -84,7 +84,7 @@ static int __init validate_parameters(voif (!bridge) {info ("not configured, disabling." ); -return 1 ; +return -EINVAL ; } str = bridge;if (!*str)@@ -147,7 +147,7 @@ static int __init cpcihp_generic_init(voinfo (DRIVER_DESC " version: " DRIVER_VERSION ); status =validate_parameters (); -if (status !=0 ) +if (status)return status; r =request_region (port,1 ,"#ENUM hotswap signal register" );
Signature · 4 lines
Scott Murray SOMA Networks, Inc. Toronto, Ontario e-mail: [email protected]