@@ -47,7 +47,7 @@ int cmd_zero_labels(int argc, const char **argv)
struct ndctl_dimm *dimm;
struct ndctl_ctx *ctx;
struct ndctl_bus *bus;
- int i, rc, count, err;
+ int i, rc, count, err = 0;
argc = parse_options(argc, argv, nmem_options, u, 0);
@@ -3019,8 +3019,8 @@ NDCTL_EXPORT int ndctl_namespace_is_enabled(struct ndctl_namespace *ndns)
static int ndctl_bind(struct ndctl_ctx *ctx, struct kmod_module *module,
const char *devname)
{
- int rc;
DIR *dir;
+ int rc = 0;
char path[200];
struct dirent *de;
const int len = sizeof(path);
Fix a couple warnings that pop when building with rpmbuild: builtin-zero-labels.c: In function 'cmd_zero_labels': builtin-zero-labels.c:50:20: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] lib/libndctl.c: In function 'ndctl_bind': lib/libndctl.c:3073:5: warning: 'rc' may be used uninitialized in this function [-Wmaybe-unini Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- builtin-zero-labels.c | 2 +- lib/libndctl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)