pdr: pldm_pdr_remove_remote_pdrs(): Exit early on bad argument

Also note the behaviour in the doxygen commentary in the header.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ie063e0685944ed06121a74b19fd13d86b2a2dcfc
diff --git a/include/libpldm/pdr.h b/include/libpldm/pdr.h
index 8112703..a20bb70 100644
--- a/include/libpldm/pdr.h
+++ b/include/libpldm/pdr.h
@@ -156,6 +156,8 @@
 /** @brief Remove all PDR records that belong to a remote terminus
  *
  *  @param[in] repo - opaque pointer acting as a PDR repo handle
+ *
+ *  If repo is NULL then there are no PDRs that can be removed.
  */
 void pldm_pdr_remove_remote_pdrs(pldm_pdr *repo);
 
diff --git a/src/pdr.c b/src/pdr.c
index d74e898..b8ac15f 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -1050,6 +1050,10 @@
 void pldm_pdr_remove_remote_pdrs(pldm_pdr *repo)
 {
 	assert(repo != NULL);
+	if (!repo) {
+		return;
+	}
+
 	bool removed = false;
 
 	pldm_pdr_record *record = repo->first;