Ver Fonte

qcacmn: Report err status if idr_find return NULL

It won't report err status since if idr_find return NULL, which cause
unnecessary process with NULL pointer.

Change-Id: I5813ddca11172f75fb73c9530e003c50e55beba2
CRs-Fixed: 2275848
Wu Gao há 6 anos atrás
pai
commit
e5b5636856
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      qdf/linux/src/qdf_idr.c

+ 1 - 1
qdf/linux/src/qdf_idr.c

@@ -133,7 +133,7 @@ QDF_STATUS qdf_idr_find(qdf_idr *idp, int32_t id, void **ptr)
 	qdf_spinlock_acquire(&idp->lock);
 	*ptr = idr_find(&idp->idr, id);
 	qdf_spinlock_release(&idp->lock);
-	if (!ptr)
+	if (!(*ptr))
 		return QDF_STATUS_E_INVAL;
 	else
 		return QDF_STATUS_SUCCESS;