From b277135f06c8a62d0447dac06ee08cd3d11fc3ac Mon Sep 17 00:00:00 2001 From: CornerOfSkyline Date: Fri, 9 Jul 2021 11:51:48 +0800 Subject: [PATCH 1/2] Fix the sem init check bug in pthread. --- components/libc/pthreads/semaphore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/libc/pthreads/semaphore.c b/components/libc/pthreads/semaphore.c index 398cdf1f49..199b33bfe8 100644 --- a/components/libc/pthreads/semaphore.c +++ b/components/libc/pthreads/semaphore.c @@ -186,7 +186,7 @@ int sem_init(sem_t *sem, int pshared, unsigned int value) rt_snprintf(name, sizeof(name), "psem%02d", psem_number++); sem->sem = rt_sem_create(name, value, RT_IPC_FLAG_FIFO); - if (sem == RT_NULL) + if (sem->sem == RT_NULL) { rt_set_errno(ENOMEM); From 9f9c3a2bb0d75e99cf1cd8c091f11c6cd1b2b1f4 Mon Sep 17 00:00:00 2001 From: "@lin12345678" Date: Fri, 9 Jul 2021 17:53:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9mmc=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E9=94=99=E8=AF=AF=EF=BC=8C=E5=B0=86card-=E3=80=8Bcsd?= =?UTF-8?q?=E5=86=99=E6=88=90card-=E3=80=8Bcid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/sdio/mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/drivers/sdio/mmc.c b/components/drivers/sdio/mmc.c index d8f3a9e0a5..bebfa39ea2 100644 --- a/components/drivers/sdio/mmc.c +++ b/components/drivers/sdio/mmc.c @@ -122,7 +122,7 @@ static int mmc_get_ext_csd(struct rt_mmcsd_card *card, rt_uint8_t **new_ext_csd) *new_ext_csd = RT_NULL; - if (GET_BITS(card->resp_cid, 122, 4) < 4) + if (GET_BITS(card->resp_csd, 122, 4) < 4) return 0; /* @@ -303,7 +303,7 @@ static int mmc_select_bus_width(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd) unsigned idx, trys, bus_width = 0; int err = 0; - if (GET_BITS(card->resp_cid, 122, 4) < 4) + if (GET_BITS(card->resp_csd, 122, 4) < 4) return 0; /*