diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c
index 589df890b3a57d185e2a43d5497c17503fb36e6d..c77ad29700addb452532ea34d41eb8b2515118cb 100644
--- a/lustre/lov/lov_obd.c
+++ b/lustre/lov/lov_obd.c
@@ -1253,7 +1253,7 @@ static int lov_destroy(struct obd_export *exp, struct obdo *oa,
         struct lov_request *req;
         struct list_head *pos;
         struct lov_obd *lov;
-        int rc = 0, err;
+        int rc = 0, err = 0;
         ENTRY;
 
         ASSERT_LSM_MAGIC(lsm);
@@ -1273,7 +1273,6 @@ static int lov_destroy(struct obd_export *exp, struct obdo *oa,
                 GOTO(out, rc);
 
         list_for_each (pos, &set->set_list) {
-                int err;
                 req = list_entry(pos, struct lov_request, rq_link);
 
                 if (oa->o_valid & OBD_MD_FLCOOKIE)