mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-15 05:11:32 +00:00
NFC: add NULL checks to avoid potential NULL pointer dereference
NULL checks at line 457: if (!link0 || !link1) {, implies that both pointers link0 and link1 might be NULL. Function nfcsim_link_free() dereference pointers link0 and link1. Add NULL checks before calling nfcsim_link_free() to avoid a potential NULL pointer dereference. Addresses-Coverity-ID: 1364857 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
03036184e9
commit
6f874bafac
@ -482,7 +482,9 @@ static int __init nfcsim_init(void)
|
||||
exit_err:
|
||||
pr_err("Failed to initialize nfcsim driver (%d)\n", rc);
|
||||
|
||||
if (link0)
|
||||
nfcsim_link_free(link0);
|
||||
if (link1)
|
||||
nfcsim_link_free(link1);
|
||||
|
||||
return rc;
|
||||
|
Loading…
Reference in New Issue
Block a user