From: Andrew Perepechko Date: Tue, 31 Aug 2010 13:18:28 +0000 (+0400) Subject: b=23216 a fix for echo_client_async_page memory allocation failure handling X-Git-Tag: v1_8_4_53~38 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=a0f9029c9b20f48f0dac0418186c9fb1c42304a1;p=fs%2Flustre-release.git b=23216 a fix for echo_client_async_page memory allocation failure handling i=Dmitry Zogin i=ZhiYong Tian --- diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 129673f..a13c1d0 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -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]); }