From f7b253f5e2c2a1a7aae7044920bb04036ee4e20b Mon Sep 17 00:00:00 2001 From: Santosh Anbu Date: Thu, 6 Jun 2019 14:35:35 +0530 Subject: [PATCH] qcacmn: Fix to release vdev reference on cmd dequeue Add change to release vdev reference only on successful removal of active cmd from serialization active queue. Change-Id: I2e14f7f53dc38388cdd05f029edc9329f9dd86a7 CRs-Fixed: 2463724 --- .../serialization/src/wlan_serialization_internal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/umac/cmn_services/serialization/src/wlan_serialization_internal.c b/umac/cmn_services/serialization/src/wlan_serialization_internal.c index 9f6442a53b1a..56509fbdb6d4 100644 --- a/umac/cmn_services/serialization/src/wlan_serialization_internal.c +++ b/umac/cmn_services/serialization/src/wlan_serialization_internal.c @@ -562,6 +562,7 @@ void wlan_serialization_generic_timer_cb(void *arg) struct wlan_serialization_timer *timer = arg; struct wlan_serialization_command *cmd = timer->cmd; struct wlan_objmgr_vdev *vdev = NULL; + enum wlan_serialization_cmd_status status; if (!cmd) { @@ -585,10 +586,11 @@ void wlan_serialization_generic_timer_cb(void *arg) * dequeue cmd API will cleanup and destroy the timer. If it fails to * dequeue command then we have to destroy the timer. */ - wlan_serialization_dequeue_cmd(cmd, SER_TIMEOUT, true); + status = wlan_serialization_dequeue_cmd(cmd, SER_TIMEOUT, true); /* Release the ref taken before the timer was started */ - wlan_objmgr_vdev_release_ref(vdev, WLAN_SERIALIZATION_ID); + if (status == WLAN_SER_CMD_IN_ACTIVE_LIST) + wlan_objmgr_vdev_release_ref(vdev, WLAN_SERIALIZATION_ID); } static QDF_STATUS wlan_serialization_mc_flush_noop(struct scheduler_msg *msg)