forked from Mirrors/opensbi
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user