[HUST CSE]NULL POINTER (#7220)
* 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) <920369182@qq.com> * 已根据代码规范进行修改,谢谢提醒 --------- Co-authored-by: Man, Jianting (Meco) <920369182@qq.com>
This commit is contained in:
parent
60835af8e1
commit
7c629d974d
|
@ -52,7 +52,7 @@ cy_rslt_t cyhal_crc_init(cyhal_crc_t *obj)
|
||||||
|
|
||||||
void cyhal_crc_free(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);
|
_cyhal_crc_calc_free(obj->base);
|
||||||
if (obj->resource.type != CYHAL_RSC_INVALID)
|
if (obj->resource.type != CYHAL_RSC_INVALID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
dtb_node_root = dtb_node_root->parent;
|
||||||
}
|
}
|
||||||
|
if(dtb_node_root == NULL) return NULL;
|
||||||
|
|
||||||
*memreserve_size = dtb_node_root->header->memreserve_sz;
|
*memreserve_size = dtb_node_root->header->memreserve_sz;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue