Whamcloud - gitweb
LU-7979 o2iblnd: fix free of IS_ERR pointer 11/19311/2
authorDmitry Eremin <dmitry.eremin@intel.com>
Mon, 4 Apr 2016 10:21:18 +0000 (13:21 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Apr 2016 02:52:28 +0000 (02:52 +0000)
Explicitly nullify pointers is case of error.

Change-Id: Ic25ef3323b8ef4e8bf1da442b2328e6801b3d252
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: http://review.whamcloud.com/19311
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
lnet/klnds/o2iblnd/o2iblnd.c

index e458797..0710987 100644 (file)
@@ -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;
                }