Browse Source

staging: lustre: lnet: fix build warning in module.c

With the latest patches from Neil, we are now getting a build warning:

drivers/staging/lustre/lnet/selftest/module.c: In function ‘lnet_selftest_init’:
drivers/staging/lustre/lnet/selftest/module.c:98:10: warning: ‘rc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   return rc;
          ^~

So fix this up by giving a default error value to rc.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman 7 years ago
parent
commit
3fc0b7d3e0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/staging/lustre/lnet/selftest/module.c

+ 1 - 1
drivers/staging/lustre/lnet/selftest/module.c

@@ -89,7 +89,7 @@ static int
 lnet_selftest_init(void)
 lnet_selftest_init(void)
 {
 {
 	int nscheds;
 	int nscheds;
-	int rc;
+	int rc = -ENOMEM;
 	int i;
 	int i;
 
 
 	lst_serial_wq = alloc_ordered_workqueue("lst_s", 0);
 	lst_serial_wq = alloc_ordered_workqueue("lst_s", 0);