diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2019-10-01 02:09:37 +0300 |
---|---|---|
committer | Bills, Jason M <jason.m.bills@intel.com> | 2019-10-09 20:25:38 +0300 |
commit | 75437659b73f004645d4d5db388b98a5c29234fb (patch) | |
tree | 6f18174dd066595571189db3d60f78a712e0ecd8 | |
parent | c1ba6721d6cb703fb1fd71651ef80f8cc287a1a9 (diff) | |
download | provingground-75437659b73f004645d4d5db388b98a5c29234fb.tar.xz |
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 <jason.m.bills@linux.intel.com>
-rw-r--r-- | libpeci/peci.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |