mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-16 03:41:24 +00:00
lib: Correct null pointer check
In order to prevent a possible null pointer dereference, return early if either one of 'in' or 'data' is null. Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
parent
5e4021a2f5
commit
6c24193293
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ static int sbi_tlb_fifo_update_cb(void *in, void *data)
|
|||
struct sbi_tlb_info *next;
|
||||
int ret = SBI_FIFO_UNCHANGED;
|
||||
|
||||
if (!in && !!data)
|
||||
if (!in || !data)
|
||||
return ret;
|
||||
|
||||
curr = (struct sbi_tlb_info *)data;
|
||||
|
|
Loading…
Add table
Reference in a new issue