[ofw] [PATCH] DAPL v2.0: dat: dat_cno_query with NULL cno_handle causes segmentation fault

Davis, Arlin R arlin.r.davis at intel.com
Mon Oct 31 13:53:52 PDT 2011


add check for NULL handle in dat library

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

diff --git a/dat/udat/udat_api.c b/dat/udat/udat_api.c
index 5948a4f..6c1549a 100644
--- a/dat/udat/udat_api.c
+++ b/dat/udat/udat_api.c
@@ -161,6 +161,9 @@ DAT_RETURN DAT_API dat_cno_query(IN DAT_CNO_HANDLE cno_handle,
 				 IN DAT_CNO_PARAM_MASK cno_param_mask,
 				 OUT DAT_CNO_PARAM * cno_param)
 {
+	if (cno_handle == NULL) {
+		return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CNO);
+	}
 	return DAT_CNO_QUERY(cno_handle, cno_param_mask, cno_param);
 }
 
-- 
1.7.3





More information about the ofw mailing list