From: Dmitry Eremin Date: Mon, 4 Apr 2016 10:21:18 +0000 (+0300) Subject: LU-7979 o2iblnd: fix free of IS_ERR pointer X-Git-Tag: 2.8.52~10 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8e80b8f52d88ddadb448b933813a43fcc96eccd9 LU-7979 o2iblnd: fix free of IS_ERR pointer Explicitly nullify pointers is case of error. Change-Id: Ic25ef3323b8ef4e8bf1da442b2328e6801b3d252 Signed-off-by: Dmitry Eremin Reviewed-on: http://review.whamcloud.com/19311 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Doug Oucharek --- diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index e458797..0710987 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -1517,6 +1517,7 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo) rc = PTR_ERR(frd->frd_frpl); CERROR("Failed to allocate ib_fast_reg_page_list: %d\n", rc); + frd->frd_frpl = NULL; goto out_middle; } @@ -1525,6 +1526,7 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo) if (IS_ERR(frd->frd_mr)) { rc = PTR_ERR(frd->frd_mr); CERROR("Failed to allocate ib_fast_reg_mr: %d\n", rc); + frd->frd_mr = NULL; goto out_middle; }