staging: lustre: lov: fix dereference of ERR_PTR
If lov_sub_get() fails then it returns the error code in ERR_PTR, but here we were dereferencing sub without checking if lov_sub_get() has actually succeeded or not. And on error we can directly return the error code from lov_io_fault_start() as it return 0 on success and the error code on error. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2ced12a7f8
commit
d0f69b5a66
|
@ -729,6 +729,8 @@ static int lov_io_fault_start(const struct lu_env *env,
|
||||||
fio = &ios->cis_io->u.ci_fault;
|
fio = &ios->cis_io->u.ci_fault;
|
||||||
lio = cl2lov_io(env, ios);
|
lio = cl2lov_io(env, ios);
|
||||||
sub = lov_sub_get(env, lio, lov_page_stripe(fio->ft_page));
|
sub = lov_sub_get(env, lio, lov_page_stripe(fio->ft_page));
|
||||||
|
if (IS_ERR(sub))
|
||||||
|
return PTR_ERR(sub);
|
||||||
sub->sub_io->u.ci_fault.ft_nob = fio->ft_nob;
|
sub->sub_io->u.ci_fault.ft_nob = fio->ft_nob;
|
||||||
lov_sub_put(sub);
|
lov_sub_put(sub);
|
||||||
return lov_io_start(env, ios);
|
return lov_io_start(env, ios);
|
||||||
|
|
Loading…
Reference in New Issue