pdr: pldm_pdr_remove_pdrs_by_terminus_handle(): Early exit on bad arg

Also add a note in the doxygen commentary in the header.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I7deb62d2ecd5db7f1a67f00a4ddaafb1046226d1
diff --git a/include/libpldm/pdr.h b/include/libpldm/pdr.h
index 01636ee..8112703 100644
--- a/include/libpldm/pdr.h
+++ b/include/libpldm/pdr.h
@@ -163,6 +163,8 @@
  *         handle
  *  @param[in] repo - opaque pointer acting as a PDR repo handle
  *  @param[in] terminus_handle - Terminus Handle of the remove PLDM terminus
+ *
+ *  If repo is NULL there are no PDRs that can be removed.
  */
 void pldm_pdr_remove_pdrs_by_terminus_handle(pldm_pdr *repo,
 					     uint16_t terminus_handle);
diff --git a/src/pdr.c b/src/pdr.c
index 4cb2bf8..d74e898 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -998,6 +998,10 @@
 					     uint16_t terminus_handle)
 {
 	assert(repo != NULL);
+	if (!repo) {
+		return;
+	}
+
 	bool removed = false;
 
 	pldm_pdr_record *record = repo->first;