From patchwork Tue Nov 23 08:36:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 12693425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10BFCC43217 for ; Tue, 23 Nov 2021 08:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9glTm0wgQrczAAl5vE6ii7klLOuOlLpsqBon7ZH/g90=; b=anRlHU9SirSSO8 kzqJWpQbS0EkrDDOgIfa/yqlvP4FVdDZLST5ZqM51rANCbpIp7t06WBPqJK+dvhlwNHmU3o6XQi29 HMDwgbdjp+1ZaMdR3Lrk2P/PyA3mGn9Q217cfEokp6QK7GKIm+6z6y8758X6R7yMEpCkbmw44Je9r CAyO1S9PIXCK1DATLVAHQo0OMiSCKm9lfG31J2VwVyOVyjQ79LRhEMNkD5mr3pDjuoEzi6bwKAA7C uoRHHIS9DJ7lFGREvxs48oVbIcTBaUYWBD9a4GW8bgyb2gnkaffJiQ7p0tdS0e/GqrLPjELyncYKJ EMDFhyxaR/OX/15tw6yA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpR6A-001H1y-3h; Tue, 23 Nov 2021 08:24:18 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpR5B-001Gh8-Hb for linux-arm-kernel@lists.infradead.org; Tue, 23 Nov 2021 08:23:19 +0000 Received: from dggeml709-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Hyxsj50K2zZd85; Tue, 23 Nov 2021 16:20:41 +0800 (CST) Received: from localhost.localdomain (10.175.102.38) by dggeml709-chm.china.huawei.com (10.3.17.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.20; Tue, 23 Nov 2021 16:23:11 +0800 From: Wei Yongjun To: , Etienne Carriere , Sudeep Holla CC: , , , Hulk Robot Subject: [PATCH -next] firmware: arm_scmi: optee: Fix missing mutex_init() Date: Tue, 23 Nov 2021 08:36:20 +0000 Message-ID: <20211123083620.2366860-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.102.38] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggeml709-chm.china.huawei.com (10.3.17.139) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_002317_819624_1ED9CF46 X-CRM114-Status: UNSURE ( 8.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver allocates the mutex but not initialize it. Use mutex_init() on it to initialize it correctly. Fixes: 5f90f189a052 ("firmware: arm_scmi: Add optee transport") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/firmware/arm_scmi/optee.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/arm_scmi/optee.c b/drivers/firmware/arm_scmi/optee.c index d9819b0197ec..901737c9f5f8 100644 --- a/drivers/firmware/arm_scmi/optee.c +++ b/drivers/firmware/arm_scmi/optee.c @@ -506,6 +506,7 @@ static int scmi_optee_service_probe(struct device *dev) agent->dev = dev; agent->tee_ctx = tee_ctx; INIT_LIST_HEAD(&agent->channel_list); + mutex_init(&agent->mu); ret = get_capabilities(agent); if (ret)