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
This commit is contained in:
Wu Gao
2018-08-14 16:04:16 +08:00
committed by nshrivas
parent 4dd4a62272
commit e5b5636856

View File

@@ -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;