From 224fd98c51469fa3428740168b557b4da0ba08e1 Mon Sep 17 00:00:00 2001 From: Yuanfang Zhang Date: Tue, 8 Mar 2022 16:01:51 +0800 Subject: [PATCH] byte-cntr: check pcie channel status before closing it Check pcie channel status before call the close channel API, only closed it when it in open state. Change-Id: Ib3bee9575edfae0cc907baee4956d6e3a6c78d61 Signed-off-by: Yuanfang Zhang --- drivers/hwtracing/coresight/coresight-byte-cntr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-byte-cntr.c b/drivers/hwtracing/coresight/coresight-byte-cntr.c index 07250b388b56..9c500245b4e2 100644 --- a/drivers/hwtracing/coresight/coresight-byte-cntr.c +++ b/drivers/hwtracing/coresight/coresight-byte-cntr.c @@ -182,7 +182,7 @@ EXPORT_SYMBOL(tmc_etr_byte_cntr_stop); static void etr_pcie_close_channel(struct byte_cntr *byte_cntr_data) { - if (!byte_cntr_data) + if (!byte_cntr_data || !byte_cntr_data->pcie_chan_opened) return; mutex_lock(&byte_cntr_data->byte_cntr_lock);