Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2644389pxb; Mon, 18 Apr 2022 05:27:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIkfBXhvVoDjVqv6pWqTynAjbKIqjw+/Zb1UXOgFeRySHMSsGCZ4Z3YslvhIGQySxQvaVC X-Received: by 2002:a05:6402:190d:b0:41b:a70d:1367 with SMTP id e13-20020a056402190d00b0041ba70d1367mr11770165edz.155.1650284835552; Mon, 18 Apr 2022 05:27:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650284835; cv=pass; d=google.com; s=arc-20160816; b=eWbKNhZSoY2+bFh7lWPz77ar/xZbTxAbuXS6omZFuoqT6B+/G2fmf1dqfr+p8Vzb1U wTh1cfSy3sE508xPBZNdksmCwC6ME9ciVVOueBieXKCv3A9a4TCGrzKdcy3pHwk39+Js vf4v904dNGVG1Ou0Lw5RHJsgV9RZC7fzapsGWP6Fjgz1k2kWGP7b6yfD+eABBJf6qJTQ lEAjcUDvVB/EUVrCkbKLehn8DCrO55AjH5CfbRIwZsWq3ypaLJfpZGWj+EARAebgZbgK +spNJmMzFHjIS0KL3lsYQ7T9M71EmGJ2YGMI492/O9P9iG0gfx5f52AD+Qptn/0esPPH nJyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=75VzsKQSsjTUwGKJt+kK8UuD8x1KhH6GBd+k7/LRkv8=; b=0hI/3oOnI9P6hOjghIQKsTZH9Q+FrD3i8I0lAKnuuOsoAzdVA7yUZ+xqEAVi8kBQlA oRORE67OvtpB6lxISHI4t3HzG1BbsPH+m5bd8AFhIo87TVR1W2BlW1vrAAmkHARiAzaP 18YRoT2mc7KBpJVYoZ+83EJfjs/naaRzpuTzi4kpjdZJm1dueV3ErFnPFfYw25fl74+W PPirwhZYep+EStHaKp29GCllkDsryPZSm+CYYy8w2CmzY+JuoE3oeJ9oFio7puCFAnB9 hfesA3zmifLOn5xpgS8YddDLUZl0VlUMEMUrdDCPJu5Bf17klma6rgWKtrPvZbwCVOki wgWQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hotmail.com header.s=selector1 header.b=F1SR9q+j; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hotmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js1-20020a170906ca8100b006e6f361280fsi5965723ejb.724.2022.04.18.05.26.51; Mon, 18 Apr 2022 05:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hotmail.com header.s=selector1 header.b=F1SR9q+j; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hotmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233324AbiDQCvo (ORCPT + 99 others); Sat, 16 Apr 2022 22:51:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232452AbiDQCvl (ORCPT ); Sat, 16 Apr 2022 22:51:41 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2065.outbound.protection.outlook.com [40.92.90.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10B30AE4D for ; Sat, 16 Apr 2022 19:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f/MZbwQEzasLiBJYsfAALVq1z+LRtpLoE9S/bImaxclFs/l7IjdyyYenomkwVUQlQQQyn3ZSXo8fTw7GaiRjhQchQtnaZs5yO08fd9I1cMDYAiIaLopiqt9wthCJT2xLenThTUxXeNdTOctic3cRb2adDOBsnHqPctXcaI23iNgcWyvIbz6XGmv/JDQT0xPz4phOo0dD477rbsO24K2VjquwLWKnuu2y8jqTxN6hLkcBdOjIm1/ZLJ2knTcnTM+W5tPNy4nEeS/6H4JLhnu8U06fqC+jEOYkUJWJyo58Q1SKrIS2fsA23Mod+DF+4Y1g525ttJbxZaWLoUBHp/+/2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=75VzsKQSsjTUwGKJt+kK8UuD8x1KhH6GBd+k7/LRkv8=; b=i+2uaHae01wNsmXtrRFKeU57akKxZExMCI/Yv8LGWc4JS+WFmXlwR7BnXWKjl2lKHrJGwljNtjVwvoXo1nNeVR9KPBY6ufWyy7uN3iTnaYpnETKClH75Vp7sKeeKlXImzIIW8wDW1yATRzP+0VUJ2JM6/wace2ZiaXCAaKWsOPVFiACp2lXdTonQmThDUDtJx2j8sNvxy2Ng37E4eqqkQrg3h0GFlmPq4uy1Y3h4CQcwN59uhDbC+4L+q4TtuwXAdvhqw7l/ajhqyiSTv+n6Cvw2z8adG/zhWvejMbOw5nrYP1l2u2svBgKqEI2zMW3cewJ67ULzQRyqGBKvPPErXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=75VzsKQSsjTUwGKJt+kK8UuD8x1KhH6GBd+k7/LRkv8=; b=F1SR9q+jt0uUOfTk+8uDvjRF7rxl/vW4236xrKhbUOCaXxTy2yJkC/cbBMkiokf+w3wYSB/eOxWq/5NIU+81P2CD9skwQyGPym/EjEcX/Srh9SpiPPOqXDVtpTNuqw6jmAwpyvJvC5V5Mdi1fwfeeoVQyBLvaH0gxtMHmdK11APRhMTnSm+tB9YNu4KRYXWVAI51iqDyS9tn4EZdwtb95tXzR+CdZwQmW5aEkw8Qg8vdpUOrC7T/Aa8Ga70iInsYwenCzvOojoVHEGQlCnenOrFBnEq4X3a5fRZrUbyu1AL8a+2zEX0GWbyMrNTGrNCcD3EyiJE+EghKvjw5Dn6bdg== Received: from PA4P189MB1421.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:c2::10) by DB6P18901MB0118.EURP189.PROD.OUTLOOK.COM (2603:10a6:4:1a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Sun, 17 Apr 2022 02:49:03 +0000 Received: from PA4P189MB1421.EURP189.PROD.OUTLOOK.COM ([fe80::e5d3:7ad0:abe1:5292]) by PA4P189MB1421.EURP189.PROD.OUTLOOK.COM ([fe80::e5d3:7ad0:abe1:5292%7]) with mapi id 15.20.5164.025; Sun, 17 Apr 2022 02:49:03 +0000 From: Saud Farooqui To: jgg@ziepe.ca, kevin.tian@intel.com, joro@8bytes.org, will@kernel.org Cc: Saud Farooqui , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kernel test robot , Julia Lawall Subject: [PATCH] iommufd: unlock ictx->vfio_compat before return. Date: Sun, 17 Apr 2022 07:48:43 +0500 Message-ID: X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [y7RZGiswIFR98qgzqgkayaTig7c88CWt] X-ClientProxiedBy: DX2P273CA0017.AREP273.PROD.OUTLOOK.COM (2603:1086:300:8::29) To PA4P189MB1421.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:c2::10) X-Microsoft-Original-Message-ID: <20220417024843.634161-1-farooqui_saud@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 03c8ac8c-c9f8-4a4e-925e-08da201cd4f3 X-MS-Exchange-SLBlob-MailProps: CjO2us0gQYBn3D7n2JOxivINDx1blzDaDLaE6fNfzaoLfF5PENMgURHaE1n3W2g5+p9uaLu7hdo5sV81IqjupHRBn8Kb87OYTmrw/kHXDVztLXMtJ1bB7mV/bFGUg4+VnHje/2in2APo5bDpWxtXyLTBOLJWvZO0AXhsB/kC36R80iuMP3WBMskLUTXaC3sHLsfDwfllTC4Q/UUQfRYi/C4f/Vk9WrdhqH0mz+rEvUjIY7dprBO5ED0Xob/Wqd03/7C8tVNlXf7HBRsVLxI4XEQrcMfjCLgYZ+G0IDo4Garu+vF+iu8BfZVa5eU0jVERhodbpOA9a0w0g281VD4xim5tdw1SksYWyOnX3PjRi0dF30VqNCY/cy/MWd92Wrlod2IiLBE15ap6NucwuafLYt/rKUme8WWGEO4tJcm1IykAUlc1E2hJIyVb1u5Ncr825PJB0JAjIflYOB/q633aZyxEJX+hrcUiNxF84v04pGUnflb+A7PaugCu4Oy79UEdyv15wC291aPtca1mEfZMvD0ntqwcMhC+tMo/iXomZDv6J+OXW2VcxzVTbgVrsz9OaSFpaN+TP6Wi8wdu/qdzUgIpUpdy4JGwx8sUAWHCz6oT/AVV8Bt/oNyQ1cNFZSe8emXKuQKMeNtCFFbmWuOOD9Ox8lgqMzKcMZhQyKGjFtzQ4CKN/+Bf3NWw5fsJr69E X-MS-TrafficTypeDiagnostic: DB6P18901MB0118:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3rogoUdIUqiKK+x247kI2JK2WCTpwwdLLn1c3NWGu77kNoRl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sr?= =?us-ascii?Q?+kQMJMZFt9lKh7OIQZ8fW5eChv4J9VIbnL3psQW7JbgiWRHWpTBwaXaeMEoD?= =?us-ascii?Q?nU5odQbUEXBIt7nuuqrKVAKyfVggcDQu4h6Y48keZrinMRHjKpJ7WBGg09i1?= =?us-ascii?Q?FVEz3YWq4e6qylU5XD8A2bjqt3Gp1fqdr+BcwXW+JwNB4dsenFKRLzWTKFUp?= =?us-ascii?Q?Q+qKOLdOXYNQn0eN2P0eL9rcEQdtFlxB?= X-OriginatorOrg: sct-15-20-4734-24-msonline-outlook-c54b5.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 03c8ac8c-c9f8-4a4e-925e-08da201cd4f3 X-MS-Exchange-CrossTenant-AuthSource: PA4P189MB1421.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2022 02:49:03.3064 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P18901MB0118 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cocci warning: drivers/iommu/iommufd/vfio_compat.c:494:2-8: preceding lock on line 491 Reported-by: kernel test robot Reported-by: Julia Lawall Signed-off-by: Saud Farooqui --- drivers/iommu/iommufd/vfio_compat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/iommufd/vfio_compat.c b/drivers/iommu/iommufd/vfio_compat.c index 5b196de00ff9..d9347df48cc8 100644 --- a/drivers/iommu/iommufd/vfio_compat.c +++ b/drivers/iommu/iommufd/vfio_compat.c @@ -491,8 +491,10 @@ void vfio_group_unset_iommufd(void *iommufd, struct list_head *device_list) return; mutex_lock(&ictx->vfio_compat); ioas = get_compat_ioas(ictx); - if (IS_ERR(ioas)) + if (IS_ERR(ioas)) { + mutex_unlock(&ictx->vfio_compat); return; + } ioas_id = ioas->obj.id; iommufd_put_object(&ioas->obj); -- 2.25.1