Support calling decode_get_pdr_resp with a NULL buffer

This commit adds support to decode_get_pdr_resp to allow callers to
supply a NULL buffer pointer to retrieve the actual length of the PDR
data.

Change-Id: I95c286b84e43cff5060bb6c269a1eca3d62161c2
diff --git a/libpldm/platform.c b/libpldm/platform.c
index 5dd388e..21c5802 100644
--- a/libpldm/platform.c
+++ b/libpldm/platform.c
@@ -216,8 +216,7 @@
 {
 	if (msg == NULL || completion_code == NULL ||
 	    next_record_hndl == NULL || next_data_transfer_hndl == NULL ||
-	    transfer_flag == NULL || resp_cnt == NULL || record_data == NULL ||
-	    transfer_crc == NULL) {
+	    transfer_flag == NULL || resp_cnt == NULL || transfer_crc == NULL) {
 		return PLDM_ERROR_INVALID_DATA;
 	}
 
@@ -249,7 +248,7 @@
 		return PLDM_ERROR_INVALID_LENGTH;
 	}
 
-	if (*resp_cnt > 0) {
+	if (*resp_cnt > 0 && record_data != NULL) {
 		if (record_data_length < *resp_cnt) {
 			return PLDM_ERROR_INVALID_LENGTH;
 		}
@@ -938,4 +937,4 @@
 		       4);
 	}
 	return PLDM_SUCCESS;
-}
\ No newline at end of file
+}