Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

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>

authored by

Akinobu Mita and committed by
Greg Kroah-Hartman
49c61cca 29f3eb64

+2 -2
+2 -2
drivers/pci/hotplug/cpcihp_generic.c
··· 84 84 85 85 if(!bridge) { 86 86 info("not configured, disabling."); 87 - return 1; 87 + return -EINVAL; 88 88 } 89 89 str = bridge; 90 90 if(!*str) ··· 147 147 148 148 info(DRIVER_DESC " version: " DRIVER_VERSION); 149 149 status = validate_parameters(); 150 - if(status != 0) 150 + if (status) 151 151 return status; 152 152 153 153 r = request_region(port, 1, "#ENUM hotswap signal register");