tiocx: check retval from bus_register()
authorJiri Kosina <jkosina@suse.cz>
Tue, 19 Mar 2013 09:36:13 +0000 (10:36 +0100)
committerTony Luck <tony.luck@intel.com>
Tue, 19 Mar 2013 23:14:52 +0000 (16:14 -0700)
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>
arch/ia64/sn/kernel/tiocx.c

index 14c1711238c0c0edf2c4a2e89250269376634d31..e35f6485c1fd1964cfb4f379dd89497e52dc4de8 100644 (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;