diff options
| author | Meco Man <[email protected]> | 2021-02-05 20:44:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-05 20:44:25 +0800 |
| commit | 852d7d7552bd3fe898115ea16ba401970b0d1fad (patch) | |
| tree | f7c13c061ecaa47e70f0f856cc685bba25866429 /components/drivers/sdio | |
| parent | 97cc8a8f72838deb0273a3e60ae29319edd7e4f7 (diff) | |
| parent | 7fc236dddb14bcf5dba8e304efde9c3a518a117c (diff) | |
Merge pull request #15 from RT-Thread/master
pr
Diffstat (limited to 'components/drivers/sdio')
| -rw-r--r-- | components/drivers/sdio/sdio.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/components/drivers/sdio/sdio.c b/components/drivers/sdio/sdio.c index f5d97cdd08..f0d5863a06 100644 --- a/components/drivers/sdio/sdio.c +++ b/components/drivers/sdio/sdio.c @@ -250,7 +250,10 @@ rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, rt_int32_t ret; rt_uint32_t left_size; rt_uint32_t max_blks, blks; - + + RT_ASSERT(func != RT_NULL); + RT_ASSERT(func->card != RT_NULL); + left_size = len; /* Do the bulk of the transfer using block mode (if supported). */ @@ -575,22 +578,26 @@ static rt_int32_t sdio_read_cis(struct rt_sdio_function *func) if (tpl_link < 4) { LOG_D("bad CISTPL_MANFID length"); - break; - } - if (func->num != 0) - { - func->manufacturer = curr->data[0]; - func->manufacturer |= curr->data[1] << 8; - func->product = curr->data[2]; - func->product |= curr->data[3] << 8; } else { - card->cis.manufacturer = curr->data[0]; - card->cis.manufacturer |= curr->data[1] << 8; - card->cis.product = curr->data[2]; - card->cis.product |= curr->data[3] << 8; + if (func->num != 0) + { + func->manufacturer = curr->data[0]; + func->manufacturer |= curr->data[1] << 8; + func->product = curr->data[2]; + func->product |= curr->data[3] << 8; + } + else + { + card->cis.manufacturer = curr->data[0]; + card->cis.manufacturer |= curr->data[1] << 8; + card->cis.product = curr->data[2]; + card->cis.product |= curr->data[3] << 8; + } } + + rt_free(curr); break; case CISTPL_FUNCE: if (func->num != 0) @@ -930,9 +937,6 @@ err3: sdio_free_cis(host->card->sdio_function[i]); rt_free(host->card->sdio_function[i]); host->card->sdio_function[i] = RT_NULL; - rt_free(host->card); - host->card = RT_NULL; - break; } } } |
