From 5fe51cc9e7637411db1e1353465fa1d32d97d31c Mon Sep 17 00:00:00 2001 From: haizhouyang Date: Thu, 20 May 2021 14:24:29 +0800 Subject: [PATCH] sync some bugfix from l2 --- support/platform/src/i2c_core.c | 4 ++-- support/platform/test/unittest/common/hdf_emmc_test.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/support/platform/src/i2c_core.c b/support/platform/src/i2c_core.c index 815e43c4d..93b6e40f8 100644 --- a/support/platform/src/i2c_core.c +++ b/support/platform/src/i2c_core.c @@ -107,7 +107,7 @@ static void I2cManagerRemoveCntlr(struct I2cCntlr *cntlr) } /* - * Find an i2c cntroller by bus number, without ref count + * Find an i2c controller by bus number, without ref count */ static struct I2cCntlr *I2cManagerFindCntlr(int16_t number) { @@ -236,7 +236,7 @@ static int32_t I2cTransferRebuildMsgs(struct HdfSBuf *data, struct I2cMsg **ppms uint8_t *bufReply = NULL; struct I2cMsg *msgs = NULL; - if (!HdfSbufReadBuffer(data, (const void **)&msgs, &len)) { + if (!HdfSbufReadBuffer(data, (const void **)&msgs, &len) || msgs == NULL) { HDF_LOGE("I2cTransferRebuildMsgs: read msgs fail!"); return HDF_ERR_IO; } diff --git a/support/platform/test/unittest/common/hdf_emmc_test.cpp b/support/platform/test/unittest/common/hdf_emmc_test.cpp index 9e1b51dd1..ab10b066e 100644 --- a/support/platform/test/unittest/common/hdf_emmc_test.cpp +++ b/support/platform/test/unittest/common/hdf_emmc_test.cpp @@ -56,7 +56,7 @@ static void TestUserEmmcGetCid(void) EmmcGetHuid(cid, EMMC_CID_LEN); for (i = 0; i < EMMC_CID_LEN; i++) { - printf("user interface get cid[%d] = 0x%x\n", i, cid[i]); + printf("user interface get cid[%u] = 0x%x\n", i, cid[i]); } } -- Gitee