From: Jinshan Xiong Date: Sat, 22 Oct 2016 00:34:49 +0000 (+0800) Subject: Staging: lustre: lov: check return value of lov_sub_get() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f99e73a5e3ff556bc69e5e592fee18d4cb7600dd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Staging: lustre: lov: check return value of lov_sub_get() Check return value of lov_sub_get() in lov_io_read_ahead(). Signed-off-by: Jinshan Xiong Reported-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c index a1d1ec9dd72e..011ab0f3ccc1 100644 --- a/drivers/staging/lustre/lustre/lov/lov_io.c +++ b/drivers/staging/lustre/lustre/lov/lov_io.c @@ -606,6 +606,8 @@ static int lov_io_read_ahead(const struct lu_env *env, return -EIO; sub = lov_sub_get(env, lio, stripe); + if (IS_ERR(sub)) + return PTR_ERR(sub); lov_stripe_offset(loo->lo_lsm, cl_offset(obj, start), stripe, &suboff); rc = cl_io_read_ahead(sub->sub_env, sub->sub_io,