Whamcloud - gitweb
LU-4629 obdclass: compile issues with variable not being initialized 05/10705/2
authorJames Simmons <uja.ornl@gmail.com>
Thu, 12 Jun 2014 21:27:26 +0000 (17:27 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 17 Jun 2014 04:01:15 +0000 (04:01 +0000)
One of the versions of gcc I have refuses to build obd_mount.c due to
index not be initialized in function lmd_make_exclusion before it is
used.

Change-Id: Ib549e595492e647364441c5d96df86ec513ad6c6
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/10705
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/obd_mount.c

index b53ba84..bfa1c12 100644 (file)
@@ -893,7 +893,8 @@ int lustre_check_exclusion(struct super_block *sb, char *svname)
 static int lmd_make_exclusion(struct lustre_mount_data *lmd, const char *ptr)
 {
        const char *s1 = ptr, *s2;
 static int lmd_make_exclusion(struct lustre_mount_data *lmd, const char *ptr)
 {
        const char *s1 = ptr, *s2;
-       __u32 index, *exclude_list;
+       __u32 *exclude_list;
+       __u32 index = 0;
        int rc = 0, devmax;
        ENTRY;
 
        int rc = 0, devmax;
        ENTRY;