Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp491077ybx; Wed, 6 Nov 2019 03:59:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyaSvdN+p3q0sSkYg+vtbahdMZ/IjMwCfyuvz6LMJpOFuqe2rpBe3RGUzD9PSlexhaa6J1c X-Received: by 2002:a50:b6f8:: with SMTP id f53mr2172342ede.29.1573041554662; Wed, 06 Nov 2019 03:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573041554; cv=none; d=google.com; s=arc-20160816; b=puUbqPfiuYdy2HEQBNBsqY+pHkHP7+yZ7DltR7StrAO8yUvj1VoV4jw1TPqwodSAc+ JR1YbhgijJcnA1RtCZH88STHA2Ks4TQ/A95REIAkVSvzf/T1NvY7XFOIzmsM6ls8gt6P jqEFhrEdExG1HfrxpyPUAVmK/1KNGFC7RZHTy0apeWCEaLYaLp4QUhE9Zlmfr65duynW brrrwtzpnNc2U8jKlRTqDJRHUYENy12SnmMaxnav+F8txQl9lfrKnxr69ivGoGfOQOU9 QyAE0lMgaLpG/fZHxoIt+8MaL9qvSt4cWS0xsWO4AKFhW4rO2ozjY4TNa42nto6Tipue uFEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=i2RtOWOHB394u44pJWnMNx1Og70D/2I/5J8lqAumzYI=; b=TyNEjHXGXTnq2MRLXdIDEDLSDX39Q4UOykBbq+qPmr/42EZmDGuYtifVHogBY7dk6f IW2m5mFrCuyMPHMy687JF6qr4GmdkPLKpk6Firauu6yGhHHFQDiM2gOcnga/PiGojOja HIoedSd6+gqlkGO0OvnpwxzDdr4Wcs5mT5WxyccTpHqjpFb4+bvI+OWK+X7Dg0BgXqxu Ll+DpqjB0HA9fNgPkVNiCuKwpNopJ0KACeoX7B0n7WY5I5/0YRp+SzQ8zh5O2JQn4Xdg 1xo/G5MsVpgok8Lubv4LT3v/i9QVFt/4QZ625dk1Dltkee2xKmOOSRl5YmLAlKKi4trH pE/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si11382523edb.234.2019.11.06.03.58.51; Wed, 06 Nov 2019 03:59:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731640AbfKFL5u (ORCPT + 99 others); Wed, 6 Nov 2019 06:57:50 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5735 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731558AbfKFL5t (ORCPT ); Wed, 6 Nov 2019 06:57:49 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 4EB74E95C445A526FAB8; Wed, 6 Nov 2019 19:57:47 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Wed, 6 Nov 2019 19:57:36 +0800 From: Wei Yongjun To: Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , Yabin Cui CC: Wei Yongjun , , , Subject: [PATCH -next] coresight: replicator: Fix missing spin_lock_init() Date: Wed, 6 Nov 2019 11:56:51 +0000 Message-ID: <20191106115651.113943-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.") Signed-off-by: Wei Yongjun --- drivers/hwtracing/coresight/coresight-replicator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c index 43304196a1a6..e7dc1c31d20d 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -248,6 +248,7 @@ static int replicator_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_SPLIT; desc.ops = &replicator_cs_ops;