NFC: Fix possible NULL dereference

NULL pointer dereference can cause runtime issue due to improper check.

Modify code to add proper check to avoid NULL pointer
dereference.

Change-Id: I51e846a6e5fd186e0aaae3e05326222a7f40ec06
Signed-off-by: Tapas Dey <tdey@codeaurora.org>
This commit is contained in:
Tapas Dey 2019-08-26 12:48:53 +05:30 committed by Gerrit - the friendly Code Review server
parent 2031377a22
commit 5a881e2a17

View file

@ -808,7 +808,7 @@ static int nfcc_hw_check(struct i2c_client *client, struct nqx_dev *nqx_dev)
}
nci_reset_ntf = kzalloc(NCI_RESET_NTF_LEN + 1, GFP_DMA | GFP_KERNEL);
if (!nci_reset_rsp) {
if (!nci_reset_ntf) {
ret = -ENOMEM;
goto done;
}