Skip to content
Commit e3675875 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

staging: lustre: lnet: avoid uninitialized return value



gcc warns that the latest workqueue change leads to returning an
uninitialized variable:

drivers/staging/lustre/lnet/selftest/module.c: In function 'lnet_selftest_init':
drivers/staging/lustre/lnet/selftest/module.c:98:10: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]

A failure from alloc_ordered_workqueue() tends to indicate an
out-of-memory condition, so return -ENOMEM in both cases.
The second error path was a preexisting bug, where we always
returned zero after a kvmalloc_array() failure.

Fixes: 6106c0f8 ("staging: lustre: lnet: convert selftest to use workqueues")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b44667b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment