api: Translate -EBADMSG as PLDM_ERROR_INVALID_DATA

For some historical reason it was previously mapped to
PLDM_ERROR_INVALID_LENGTH. -EBADMSG typically means the provided
information is inconsistent in some way rather than improperly bounded,
so fix that now.

Change-Id: Ie0fe2c6f9742387f951d5abe81f12f9f7b7aff24
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/api.h b/src/api.h
index f99f3ed..643fbff 100644
--- a/src/api.h
+++ b/src/api.h
@@ -27,12 +27,12 @@
 	assert(err < 0);
 	switch (err) {
 	case -EINVAL:
+	case -EBADMSG:
 		rc = PLDM_ERROR_INVALID_DATA;
 		break;
 	case -ENOMSG:
 		rc = PLDM_ERROR_INVALID_PLDM_TYPE;
 		break;
-	case -EBADMSG:
 	case -EOVERFLOW:
 		rc = PLDM_ERROR_INVALID_LENGTH;
 		break;