Ver Fonte

qcacmn: Check for NULL pointer before de-referencing it

Pointer 'hif_ctx' returned from call to function 'cds_get_context'
may be NULL. Check for NULL pointer before de-referencing it.

Change-Id: I6c909b2c62e1bf6945a4cc40315e8fdad4a0aa83
CRs-Fixed: 2726335
Aditya Kodukula há 5 anos atrás
pai
commit
b25366fa6f
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      qdf/linux/src/qdf_lock.c

+ 3 - 0
qdf/linux/src/qdf_lock.c

@@ -583,6 +583,9 @@ void qdf_runtime_lock_deinit(qdf_runtime_lock_t *lock)
 {
 	void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
 
+	if (!hif_ctx)
+		return;
+
 	if (!lock)
 		return;