Skip to content

Commit

Permalink
[HUST CSE]NULL POINTER (RT-Thread#7220)
Browse files Browse the repository at this point in the history
* avoids the risk of a null pointer

* 将||改成&&来判断断言
There is a possibility of a null pointer

* there is a possibility of a null pointer

* Update components/drivers/fdt/src/dtb_get.c

Co-authored-by: Man, Jianting (Meco) <[email protected]>

* 已根据代码规范进行修改,谢谢提醒

---------

Co-authored-by: Man, Jianting (Meco) <[email protected]>
  • Loading branch information
yu44MTX and mysterywolf authored Apr 17, 2023
1 parent 60835af commit 7c629d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cy_rslt_t cyhal_crc_init(cyhal_crc_t *obj)

void cyhal_crc_free(cyhal_crc_t *obj)
{
CY_ASSERT(NULL != obj&&obj->resource.type != CYHAL_RSC_CRYPTO);
CY_ASSERT(NULL != obj && obj->resource.type != CYHAL_RSC_CRYPTO);
_cyhal_crc_calc_free(obj->base);
if (obj->resource.type != CYHAL_RSC_INVALID)
{
Expand Down
1 change: 1 addition & 0 deletions components/drivers/fdt/src/dtb_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ struct dtb_memreserve *dtb_node_get_dtb_memreserve(struct dtb_node *dtb_node, in
}
dtb_node_root = dtb_node_root->parent;
}
if(dtb_node_root == NULL) return NULL;

*memreserve_size = dtb_node_root->header->memreserve_sz;

Expand Down

0 comments on commit 7c629d9

Please sign in to comment.