From 12d07c9ed61ecc8dd3fc8ef277c5758c8b44b7aa Mon Sep 17 00:00:00 2001 From: Yuanfang Zhang Date: Wed, 30 Jun 2021 18:11:14 +0800 Subject: [PATCH] coresight-tmc-etr: use sysfs_buf in tmc_sg_get_rwp_offset() When usb bypass start, etr_buf may be null. If etr disable hw is called at the same time. Use sysfs_buf in tmc_sg_get_rwp_offset to avoid this issue. Change-Id: Id1e45269d08f61413d385de7aa46df4cc3d8c44d Signed-off-by: Yuanfang Zhang --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index df6e21f27777..86987252862f 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -275,7 +275,7 @@ void tmc_free_sg_table(struct tmc_sg_table *sg_table) long tmc_sg_get_rwp_offset(struct tmc_drvdata *drvdata) { - struct etr_buf *etr_buf = drvdata->etr_buf; + struct etr_buf *etr_buf = drvdata->sysfs_buf; struct etr_sg_table *etr_table = etr_buf->private; struct tmc_sg_table *table = etr_table->sg_table; u64 rwp;