From: eeb Date: Mon, 15 Nov 2004 11:53:26 +0000 (+0000) Subject: * Fixed incorrect handling of 'eq == NULL' in ptl_eq2handle() X-Git-Tag: 1.3.4~326 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=ea9014131508e8b27eb2ad04d8a43a7a8b93025e;p=fs%2Flustre-release.git * Fixed incorrect handling of 'eq == NULL' in ptl_eq2handle() --- diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 4daf219..b710569 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -279,6 +279,11 @@ extern void lib_invalidate_handle (lib_nal_t *nal, lib_handle_t *lh); static inline void ptl_eq2handle (ptl_handle_eq_t *handle, lib_nal_t *nal, lib_eq_t *eq) { + if (eq == NULL) { + *handle = PTL_EQ_NONE; + return; + } + handle->nal_idx = nal->libnal_ni.ni_api->nal_handle.nal_idx; handle->cookie = eq->eq_lh.lh_cookie; } diff --git a/lnet/include/lnet/lib-p30.h b/lnet/include/lnet/lib-p30.h index 4daf219..b710569 100644 --- a/lnet/include/lnet/lib-p30.h +++ b/lnet/include/lnet/lib-p30.h @@ -279,6 +279,11 @@ extern void lib_invalidate_handle (lib_nal_t *nal, lib_handle_t *lh); static inline void ptl_eq2handle (ptl_handle_eq_t *handle, lib_nal_t *nal, lib_eq_t *eq) { + if (eq == NULL) { + *handle = PTL_EQ_NONE; + return; + } + handle->nal_idx = nal->libnal_ni.ni_api->nal_handle.nal_idx; handle->cookie = eq->eq_lh.lh_cookie; } diff --git a/lustre/portals/include/portals/lib-p30.h b/lustre/portals/include/portals/lib-p30.h index 4daf219..b710569 100644 --- a/lustre/portals/include/portals/lib-p30.h +++ b/lustre/portals/include/portals/lib-p30.h @@ -279,6 +279,11 @@ extern void lib_invalidate_handle (lib_nal_t *nal, lib_handle_t *lh); static inline void ptl_eq2handle (ptl_handle_eq_t *handle, lib_nal_t *nal, lib_eq_t *eq) { + if (eq == NULL) { + *handle = PTL_EQ_NONE; + return; + } + handle->nal_idx = nal->libnal_ni.ni_api->nal_handle.nal_idx; handle->cookie = eq->eq_lh.lh_cookie; }