diff mbox series

[1/2] coresight: funnel: Fix missing spin_lock_init()

Message ID 20191118185207.30441-2-mathieu.poirier@linaro.org
State New
Headers show
Series coresight: next v5.4-rc8 | expand

Commit Message

Mathieu Poirier Nov. 18, 2019, 6:52 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>


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>

---
 drivers/hwtracing/coresight/coresight-funnel.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.17.1

Comments

Greg Kroah-Hartman Nov. 19, 2019, 4:30 a.m. UTC | #1
On Mon, Nov 18, 2019 at 11:52:06AM -0700, Mathieu Poirier wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>

> 

> 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>

> ---

>  drivers/hwtracing/coresight/coresight-funnel.c | 1 +

>  1 file changed, 1 insertion(+)


Is this, and the 2/2 patch here, needed for stable releases?

thanks,

greg k-h
Mathieu Poirier Nov. 19, 2019, 4:15 p.m. UTC | #2
On Mon, 18 Nov 2019 at 21:30, Greg KH <gregkh@linuxfoundation.org> wrote:
>

> On Mon, Nov 18, 2019 at 11:52:06AM -0700, Mathieu Poirier wrote:

> > From: Wei Yongjun <weiyongjun1@huawei.com>

> >

> > 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>

> > ---

> >  drivers/hwtracing/coresight/coresight-funnel.c | 1 +

> >  1 file changed, 1 insertion(+)

>

> Is this, and the 2/2 patch here, needed for stable releases?


No as the code they fix is new to this cycle[1].

Thanks for being inquisitive,
Mathieu

[1]. https://lkml.org/lkml/2019/11/4/726

>

> thanks,

>

> greg k-h
diff mbox series

Patch

diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
index b605889b507a..900690a9f7f0 100644
--- a/drivers/hwtracing/coresight/coresight-funnel.c
+++ b/drivers/hwtracing/coresight/coresight-funnel.c
@@ -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;