SuSE checker found some minor issues:
- refwwid in libmultipath/configure.c:get_refwwid() might be used
uninitialized. As dev_type is a simple 'int' there is nothing which
prevents the unsuspecting user to call it with an unhandled value.
We shoud rather use an enum and set refwwid to NULL to be on the safe
side.
- attr in libmultipath/discovery.c:devt2devname() might be used
uninitialized. Quite unlikely, but might happen in principle.
So better have it initialized.
- r in multipath/main.c:main() might be used uninitialized.
True. So have it initialized.
int with_sysfs;
int pgpolicy;
struct checker * checker;
- int dev_type;
+ enum devtypes dev_type;
int minio;
int checkint;
int max_checkint;
}
extern char *
-get_refwwid (char * dev, int dev_type, vector pathvec)
+get_refwwid (char * dev, enum devtypes dev_type, vector pathvec)
{
struct path * pp;
char buff[FILE_NAME_SIZE];
- char * refwwid;
+ char * refwwid = NULL;
if (dev_type == DEV_NONE)
return NULL;
int domap (struct multipath * mpp);
int reinstate_paths (struct multipath *mpp);
int coalesce_paths (struct vectors *vecs, vector curmp, char * refwwid);
-char * get_refwwid (char * dev, int dev_type, vector pathvec);
+char * get_refwwid (char * dev, enum devtypes dev_type, vector pathvec);
struct dlist * ls;
char attr_path[FILE_NAME_SIZE];
char block_path[FILE_NAME_SIZE];
- struct sysfs_attribute * attr;
+ struct sysfs_attribute * attr = NULL;
struct sysfs_class * class;
struct sysfs_class_device * dev;
#include "structs_vec.h"
#include "print.h"
#include "dmparser.h"
-#include "configure.h"
#include "config.h"
+#include "configure.h"
#include "pgpolicies.h"
#include "defaults.h"
#include "parser.h"
int arg;
extern char *optarg;
extern int optind;
- int i, r;
+ int i, r = 1;
if (getuid() != 0) {
fprintf(stderr, "need to be root\n");