From 8118759dd0a9547a7763cc0551de70f310baa4ff Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Wed, 6 Nov 2019 11:56:51 +0000 Subject: [PATCH] BACKPORT:FROMGIT: coresight: replicator: Fix missing spin_lock_init() Backport: change in coresight-dynamic-replicator.c instead of coresight-replicator.c. The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun Tested-by: Yabin Cui Signed-off-by: Mathieu Poirier (cherry picked from commit 372697412e921ae550a2da485526aeb3abee955d https://git.linaro.org/kernel/coresight.git next) Bug: 140266694 Change-Id: I16b76d71049b93b8804efecaae20828a019aabe0 Signed-off-by: Yabin Cui --- drivers/hwtracing/coresight/coresight-dynamic-replicator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwtracing/coresight/coresight-dynamic-replicator.c b/drivers/hwtracing/coresight/coresight-dynamic-replicator.c index a48215b9fc19..8be9ed16bc33 100644 --- a/drivers/hwtracing/coresight/coresight-dynamic-replicator.c +++ b/drivers/hwtracing/coresight/coresight-dynamic-replicator.c @@ -223,6 +223,7 @@ static int replicator_probe(struct amba_device *adev, const struct amba_id *id) dev_set_drvdata(dev, drvdata); pm_runtime_put(&adev->dev); + spin_lock_init(&drvdata->spinlock); desc.type = CORESIGHT_DEV_TYPE_LINK; desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT; desc.ops = &replicator_cs_ops;