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 <jinshan.xiong@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jinshan Xiong 2016-10-22 08:34:49 +08:00 committed by Greg Kroah-Hartman
parent 1b301e8343
commit f99e73a5e3
1 changed files with 2 additions and 0 deletions

View File

@ -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,