From 75437659b73f004645d4d5db388b98a5c29234fb Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Mon, 30 Sep 2019 16:09:37 -0700 Subject: Allow raw PECI ping commands The PECI ping command has a read length of zero, so when it's called the response buffer is NULL since it has a size of zero. This change allows the command to continue with a NULL response buffer pointer as long as the read length is zero. Tested: Sent a raw ping command to a present CPU and got a successful response. Sent a raw ping command to a not-present CPU and got a failed response. Sent a raw read package config command and got the expected data. Change-Id: I3e672b68e60716c8e239cab569d400f24760cb5b Signed-off-by: Jason M. Bills --- libpeci/peci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpeci/peci.c b/libpeci/peci.c index 400e2b5..1d97b93 100644 --- a/libpeci/peci.c +++ b/libpeci/peci.c @@ -1021,7 +1021,7 @@ EPECIStatus peci_raw(uint8_t target, uint8_t u8ReadLen, const uint8_t* pRawCmd, uint8_t u8RxBuf[PECI_BUFFER_SIZE]; EPECIStatus ret; - if (pRawResp == NULL) + if (u8ReadLen && pRawResp == NULL) { return PECI_CC_INVALID_REQ; } -- cgit v1.2.3