Whamcloud - gitweb
LU-4629 obdclass: Fix uninitialized variables 13/10613/2
authorDmitry Eremin <dmitry.eremin@intel.com>
Thu, 5 Jun 2014 18:52:15 +0000 (22:52 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 11 Jun 2014 03:01:35 +0000 (03:01 +0000)
'sd.page_link' is used uninitialized in this function.
'ss.page_link' is used uninitialized in this function.
'sl.page_link' is used uninitialized in this function.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I5f571fe2b5dc9007720601292484dbf24a348b83
Reviewed-on: http://review.whamcloud.com/10613
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/obdclass/capa.c

index 29c40c1..daa82bc 100644 (file)
@@ -265,6 +265,7 @@ int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key)
         }
         keylen = alg->ha_keylen;
 
+       sg_init_table(&sl, 1);
         sg_set_page(&sl, virt_to_page(capa),
                     offsetof(struct lustre_capa, lc_hmac),
                    (unsigned long)(capa) % PAGE_CACHE_SIZE);
@@ -307,9 +308,11 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
                 GOTO(out, rc);
         }
 
+       sg_init_table(&sd, 1);
        sg_set_page(&sd, virt_to_page(d), 16,
                    (unsigned long)(d) % PAGE_CACHE_SIZE);
 
+       sg_init_table(&ss, 1);
        sg_set_page(&ss, virt_to_page(s), 16,
                    (unsigned long)(s) % PAGE_CACHE_SIZE);
         desc.tfm   = tfm;
@@ -360,9 +363,11 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
                 GOTO(out, rc);
         }
 
+       sg_init_table(&sd, 1);
        sg_set_page(&sd, virt_to_page(d), 16,
                    (unsigned long)(d) % PAGE_CACHE_SIZE);
 
+       sg_init_table(&ss, 1);
        sg_set_page(&ss, virt_to_page(s), 16,
                    (unsigned long)(s) % PAGE_CACHE_SIZE);