Whamcloud - gitweb
Branch b1_8_gate
authortianzy <tianzy>
Fri, 31 Oct 2008 07:51:41 +0000 (07:51 +0000)
committertianzy <tianzy>
Fri, 31 Oct 2008 07:51:41 +0000 (07:51 +0000)
fix a possible NULL pointer in client_quota_ctl()
b=17486
i=johann
i=panda

lustre/quota/quota_ctl.c

index 900f1ce..154a39f 100644 (file)
@@ -289,8 +289,10 @@ int client_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl)
                 GOTO(out, rc);
         }
 
-        oqc = lustre_swab_repbuf(req, REPLY_REC_OFF, sizeof(*oqc),
-                                 lustre_swab_obd_quotactl);
+        oqc = NULL;
+        if (req->rq_repmsg)
+                oqc = lustre_swab_repbuf(req, REPLY_REC_OFF, sizeof(*oqc),
+                                         lustre_swab_obd_quotactl);
         if (oqc == NULL) {
                 CERROR ("Can't unpack obd_quotactl\n");
                 GOTO(out, rc = -EPROTO);