On 10/16, Jeff Moyer wrote:
Coverity complains that rc, passed to btt_xlat_status, may be
used uninitialized. In that case, we may also dereference a
NULL pointer. Fix it by only calling btt_xlat_status with a
valid arena.
Signed-off-by: Jeff Moyer <jmoyer(a)redhat.com>
Good catch!
Reviewed-by: Vishal Verma <vishal.l.verma(a)intel.com>
diff --git a/ndctl/check.c b/ndctl/check.c
index 915bb9d..93f95c6 100644
--- a/ndctl/check.c
+++ b/ndctl/check.c
@@ -582,9 +582,10 @@ static int btt_check_arenas(struct btt_chk *bttc)
break;
}
- btt_xlat_status(a, rc);
- if (rc)
+ if (a && rc != BTT_OK) {
+ btt_xlat_status(a, rc);
return -ENXIO;
+ }
return 0;
}
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm(a)lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm