[ofw] [PATCH 8/13] DAPL v2.0: dat: add check for NULL handle on IA calls

Davis, Arlin R arlin.r.davis at intel.com
Fri Jan 13 15:55:40 PST 2012


check added to dats_get_ia_handle()

Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dat/common/dat_api.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dat/common/dat_api.c b/dat/common/dat_api.c
index 4e6eadd..f53ead7 100755
--- a/dat/common/dat_api.c
+++ b/dat/common/dat_api.c
@@ -178,6 +178,9 @@ dats_get_ia_handle(IN DAT_IA_HANDLE handle, OUT DAT_IA_HANDLE * ia_handle_p)
 {
 	DAT_RETURN dat_status = DAT_SUCCESS;
 
+	if (handle == NULL)
+		return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
+
 	/* handle to vector */
 	if (DAT_IA_HANDLE_TO_UL(handle) >= g_hv.handle_max) {
 		unsigned long i;
-- 
1.7.3





More information about the ofw mailing list