Browse Source

Driver: eSE : checking NULL pointer

NFC: set the rsp buffer to null
set the response buffer to null in order to avoid
invalid free

Change-Id: Id92aca9255e4e58cc03822a1af1adf6fbbdfa443
Signed-off-by: PRANAY BHARGAV BHAVARAJU <[email protected]>
PRANAY BHARGAV BHAVARAJU 2 years ago
parent
commit
54561969eb
1 changed files with 2 additions and 1 deletions
  1. 2 1
      nfc/ese_cold_reset.c

+ 2 - 1
nfc/ese_cold_reset.c

@@ -375,11 +375,12 @@ int ese_cold_reset_ioctl(struct nfc_dev *nfc_dev, unsigned long arg)
 		pr_debug("ese cmd is %d\n", cold_reset_arg->sub_cmd);
 
 	ret = nfc_dev->cold_reset.status;
+
 err:
 	kfree(nfc_dev->cold_reset.cmd_buf);
+	nfc_dev->cold_reset.cmd_buf = NULL;
 	kfree(cold_reset_arg);
 	cold_reset_arg = NULL;
-	nfc_dev->cold_reset.cmd_buf = NULL;
 
 	return ret;
 }