]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
coresight: funnel: Fix missing spin_lock_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 18 Nov 2019 18:52:06 +0000 (11:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Nov 2019 18:18:15 +0000 (19:18 +0100)
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 <weiyongjun1@huawei.com>
Tested-by: Yabin Cui <yabinc@google.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20191118185207.30441-2-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-funnel.c

index b605889b507a948dc357854582f7a73371eea26c..900690a9f7f0d26ea0181abb2f7db83107749cba 100644 (file)
@@ -253,6 +253,7 @@ static int funnel_probe(struct device *dev, struct resource *res)
        }
        dev->platform_data = pdata;
 
+       spin_lock_init(&drvdata->spinlock);
        desc.type = CORESIGHT_DEV_TYPE_LINK;
        desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_MERG;
        desc.ops = &funnel_cs_ops;