pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments

Improve assert()-safety by exploiting the fact that it's already valid
for the function to return NULL.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I9d7d0a667801a87dbcfeadfa9a4fd084a87e48db
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e0c7d0a..383aa2e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -51,6 +51,7 @@
    - pldm_pdr_record_is_remote()
 
 9. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor
+10. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments
 
 ### Deprecated
 
diff --git a/src/pdr.c b/src/pdr.c
index 5012d88..a58a2cc 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -319,6 +319,10 @@
 	assert(entity_type != NULL);
 	assert(entity_instance_num != NULL);
 	assert(container_id != NULL);
+	if (!repo || !terminus_handle || !entity_type || !entity_instance_num ||
+	    !container_id) {
+		return NULL;
+	}
 
 	uint8_t *data = NULL;
 	uint32_t size = 0;