tiocx: check retval from bus_register()

Properly check return value from bus_register() and propagate it out of
tiocx_init() in case of failure.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
Jiri Kosina 2013-03-19 10:36:13 +01:00 committed by Tony Luck
parent a937536b86
commit d7c6797fbc
1 changed files with 4 additions and 1 deletions

View File

@ -490,11 +490,14 @@ static int __init tiocx_init(void)
{
cnodeid_t cnodeid;
int found_tiocx_device = 0;
int err;
if (!ia64_platform_is("sn2"))
return 0;
bus_register(&tiocx_bus_type);
err = bus_register(&tiocx_bus_type);
if (err)
return err;
for (cnodeid = 0; cnodeid < num_cnodes; cnodeid++) {
nasid_t nasid;