diff options
| author | Jacob Garber <[email protected]> | 2019-08-09 17:14:00 -0600 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2019-08-12 09:27:47 +0530 |
| commit | 6c24193293e7cc0854994d7551f32e31ebc06ff6 (patch) | |
| tree | 8b1be96555799f446d346a380d4a4a74d977d636 | |
| parent | 5e4021a2f5ca346d1c12b80d346c1a2e7eb4b501 (diff) | |
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 <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_tlb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi/sbi_tlb.c b/lib/sbi/sbi_tlb.c index cffda52d..104c066c 100644 --- a/lib/sbi/sbi_tlb.c +++ b/lib/sbi/sbi_tlb.c @@ -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; |
