From patchwork Sun Jan 19 02:30:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1225341 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 480f616j9Mz9sRG for ; Sun, 19 Jan 2020 13:35:05 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbgASCew (ORCPT ); Sat, 18 Jan 2020 21:34:52 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9660 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727403AbgASCew (ORCPT ); Sat, 18 Jan 2020 21:34:52 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id CEC81BD76778FA04D00C; Sun, 19 Jan 2020 10:34:48 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Sun, 19 Jan 2020 10:34:42 +0800 From: Wei Yongjun To: Lorenzo Pieralisi , Andrew Murray , Bjorn Helgaas , "Florian Fainelli" , Jim Quinlan CC: Wei Yongjun , , , , Subject: [PATCH -next] PCI: brcmstb: Fix missing mutex_init() Date: Sun, 19 Jan 2020 02:30:03 +0000 Message-ID: <20200119023003.100987-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The driver allocates the mutex but not initialize it. Use mutex_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Fixes: 72af6f6f0d13 ("PCI: brcmstb: Add MSI support") Signed-off-by: Wei Yongjun Reviewed-by: Florian Fainelli --- drivers/pci/controller/pcie-brcmstb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 43cba76c0e1e..065bada9cfad 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -528,6 +528,7 @@ static int brcm_pcie_enable_msi(struct brcm_pcie *pcie) if (!msi) return -ENOMEM; + mutex_init(&msi->lock); msi->dev = dev; msi->base = pcie->base; msi->np = pcie->np;