Parcourir la source

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 il y a 6 ans
Parent
commit
e5b5636856
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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;