mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 05:29:04 -04:00
qcacmn: Verify id before removing idr
It causes kernel warning if remove an invalid id. So, verify id before removing idr. Change-Id: I22cd5753a6e4fae0087faaee1c722017523b311e CRs-Fixed: 2271235
This commit is contained in:
parent
f1e0766647
commit
661ec9d74a
1 changed files with 2 additions and 1 deletions
|
|
@ -116,7 +116,8 @@ QDF_STATUS qdf_idr_remove(qdf_idr *idp, int32_t id)
|
|||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
qdf_spinlock_acquire(&idp->lock);
|
||||
idr_remove(&idp->idr, id);
|
||||
if (idr_find(&idp->idr, id))
|
||||
idr_remove(&idp->idr, id);
|
||||
qdf_spinlock_release(&idp->lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
|
|
|||
Loading…
Reference in a new issue