diff --git a/support/platform/src/i2c_core.c b/support/platform/src/i2c_core.c index 815e43c4d300b1b60ad5fb1857194b397d83728c..93b6e40f88f69a0bfddd57588f0d89e5d2f8d296 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 9e1b51dd15b330c309aec7bd703ae4526b03f4dd..ab10b066e598d37760f59505db8f348ae9dd4eff 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]); } }