From 315d67f3f48c36058a1f4935f0c7c2c4db823f63 Mon Sep 17 00:00:00 2001 From: bings Date: Wed, 30 May 2018 11:05:27 +0800 Subject: [PATCH] qcacmn: Fix pl_info->log_stat update If log state 1, 2, 0, 1 are set serially, log state 2 can't be set successfully, while log state 1 is set to wdi twice, which results in two same pointers in doubly linked list txrx_pdev->wdi_event_list and causes dead loop. Update pl_info->log_stat only when it is subscribed to wdi and sent to firmware successfully. Change-Id: I8d67b9f02a2fb2c958d2553a743cbabcedfb2f42 CRs-Fixed: 2250715 --- utils/pktlog/pktlog_ac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/pktlog/pktlog_ac.c b/utils/pktlog/pktlog_ac.c index 16cbe4d7a1..b8ed31de7e 100644 --- a/utils/pktlog/pktlog_ac.c +++ b/utils/pktlog/pktlog_ac.c @@ -618,8 +618,11 @@ static int __pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, __func__); return -EINVAL; } + } else { + qdf_print("Unable to subscribe %d to the WDI %s\n", + log_state, __func__); + return -EINVAL; } - pl_dev->is_pktlog_cb_subscribed = true; /* WMI command to enable pktlog on the firmware */ if (pktlog_enable_tgt(scn, log_state, ini_triggered, user_triggered)) { @@ -627,6 +630,7 @@ static int __pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, qdf_print("Device cannot be enabled, %s\n", __func__); return -EINVAL; } + pl_dev->is_pktlog_cb_subscribed = true; if (is_iwpriv_command == 0) pl_dev->vendor_cmd_send = true;