Whamcloud - gitweb
b=23216 a fix for echo_client_async_page memory allocation failure handling
authorAndrew Perepechko <Andrew.Perepechko@sun.com>
Tue, 31 Aug 2010 13:18:28 +0000 (17:18 +0400)
committerJohann Lombardi <johann.lombardi@oracle.com>
Tue, 31 Aug 2010 22:06:38 +0000 (00:06 +0200)
i=Dmitry Zogin
i=ZhiYong Tian

lustre/obdecho/echo_client.c

index 129673f..a13c1d0 100644 (file)
@@ -863,15 +863,17 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
 out:
         if (aps != NULL) {
                 for (i = 0; i < npages; ++ i) {
-                        cfs_page_t *page;
-
                         eap = aps[i];
-                        page = eap->eap_page;
-                        if (eap->eap_cookie != NULL)
-                                obd_teardown_async_page(exp, lsm, NULL,
-                                                        eap->eap_cookie);
-                        OBD_FREE(eap, sizeof(*eap));
-                        OBD_PAGE_FREE(page);
+                        if (eap != NULL) {
+                                cfs_page_t *page;
+
+                                page = eap->eap_page;
+                                if (eap->eap_cookie != NULL)
+                                        obd_teardown_async_page(exp, lsm, NULL,
+                                                                eap->eap_cookie);
+                                OBD_FREE(eap, sizeof(*eap));
+                                OBD_PAGE_FREE(page);
+                        }
                 }
                 OBD_FREE(aps, npages * sizeof aps[0]);
         }