Message ID | 9-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <kvm-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D9F3C433B4 for <kvm@archiver.kernel.org>; Tue, 6 Apr 2021 19:40:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF85E613DE for <kvm@archiver.kernel.org>; Tue, 6 Apr 2021 19:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244915AbhDFTlA (ORCPT <rfc822;kvm@archiver.kernel.org>); Tue, 6 Apr 2021 15:41:00 -0400 Received: from mail-mw2nam10on2073.outbound.protection.outlook.com ([40.107.94.73]:54032 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235032AbhDFTk5 (ORCPT <rfc822;kvm@vger.kernel.org>); Tue, 6 Apr 2021 15:40:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cfbPpJiat9bST4GziGqhtwNdaFel3xtWs04OhQ2BlNPaWRmF1KQvWvTuoIWd5h+0THupJIIMJrRqbpVBTBRIGPp0ayralr18pfp7g/28WOMoBSNTIAbUBx4QsNK0dwclMWwjQXseszv4itVZ16P/kaf9wFko2gyZ1w1QncnT9pQJH/sRhHGU6F0dS2lQqOxx0S+UkaV1MWukHDn00xRJ1mg4ffR3QGznXjNfRlwO9ZpUo51whypq7/Qs8jlTWB3tmwbuvXcpYF6vWnz9LcFDzUCzfPMj8j7J8IbkU5Fp3bL2UPkTuCktv1sprjlK/gP9DYMbdUHhypSMJYyO9jHUEA== 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-SenderADCheck; bh=LSRdrvt55b4sprMaz3bT72yodWqW13fHhTN3k5Mj700=; b=WkeQ72kSepRJP+WBFoZETwihhTuSfzak7A178B/p8ybxkLee1l0Lzm/3ewelymIj0JciYy2VJhbg0wypJWVeEdOSomgPrsBtdJvWIIOAY7sUKpD7QX4w0GZG/ZccbTedHHFRMw20oBQB3InUeBsYhgnKF7FNLMKN5iVEGOHaE48GGbGJN7wpPtow8Wxe0elwYprB10ry3G9EIdUgse8D0bLT6ZZNJaokzz0yZEQIMLq3otKn1OYMULE/STs7WIMdVcDEtpQaRFbBjPCOZljOABcG1L77GbI2J0XA2uAbOKn9hoNMmNo9aL4+4NhKrzNCKMAN7UNpaSbFx4e5H9TW6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LSRdrvt55b4sprMaz3bT72yodWqW13fHhTN3k5Mj700=; b=rBMK04FATIgoAsWjseAOGg/S9qVBR9k720cVdpeN7ZX50O75Y82HkiC6ceytybItBtt6B3V1OWsOTiNrE9MSmCjBE6LYDXo5WEt68aaDg8zsX9apGU9oQBMopACwWwcAPkKUvTlG+rgHgW+NpYuOtx5xw1s/c+ghtX8+lBB+1/f3F4EA4oEjsG1Qq9+TpYwXzfUBLr1UTIkFahG/e0qC8VKF4PgbM8u3YDAzqwd7HWMcSgU6VClB6yB0/XW8IJUS38OZ4ePHtRq2mz/opaNqRpaZa0gyd6BF7HxM+8TkTJqdVeHwTEVKdK/8Pc5G8RVtwW6yelpjsU+ZsvKDipIJYQ== Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) by DM6PR12MB3515.namprd12.prod.outlook.com (2603:10b6:5:15f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Tue, 6 Apr 2021 19:40:47 +0000 Received: from DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::1c62:7fa3:617b:ab87]) by DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::1c62:7fa3:617b:ab87%6]) with mapi id 15.20.3999.032; Tue, 6 Apr 2021 19:40:47 +0000 From: Jason Gunthorpe <jgg@nvidia.com> To: kvm@vger.kernel.org Cc: Alex Williamson <alex.williamson@redhat.com>, "Raj, Ashok" <ashok.raj@intel.com>, Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>, Neo Jia <cjia@nvidia.com>, Cornelia Huck <cohuck@redhat.com>, Dan Williams <dan.j.williams@intel.com>, Christoph Hellwig <hch@lst.de>, Jike Song <jike.song@intel.com>, Kevin Tian <kevin.tian@intel.com>, Kirti Wankhede <kwankhede@nvidia.com>, Leon Romanovsky <leonro@nvidia.com>, Max Gurtovoy <mgurtovoy@nvidia.com>, Tarun Gupta <targupta@nvidia.com> Subject: [PATCH v2 09/18] vfio/mdev: Add missing error handling to dev_set_name() Date: Tue, 6 Apr 2021 16:40:32 -0300 Message-Id: <9-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com> In-Reply-To: <0-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com> References: Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [142.162.115.133] X-ClientProxiedBy: MN2PR12CA0035.namprd12.prod.outlook.com (2603:10b6:208:a8::48) To DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (142.162.115.133) by MN2PR12CA0035.namprd12.prod.outlook.com (2603:10b6:208:a8::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.29 via Frontend Transport; Tue, 6 Apr 2021 19:40:44 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from <jgg@nvidia.com>) id 1lTrZ4-001mXO-6S; Tue, 06 Apr 2021 16:40:42 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 26a95afb-d2f6-4646-333c-08d8f933de5c X-MS-TrafficTypeDiagnostic: DM6PR12MB3515: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <DM6PR12MB351556B86BDCAFBDA0CED876C2769@DM6PR12MB3515.namprd12.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KlUZlGdd3f73OXZ9nddGmK7UqoSGz/CBjjxf5K9PkBNsdEszrJ3Bgwo5JU7SqnYHxye8Mrqt/TDpa8WtPPTYpdLs+7uZKNsiWWBnA3/jv+KgeOJY82W/rbOFGrELxpoGssE/fYe8DMXeqENwFsKJJYcAyrzeaL8y9o9cqRlY+YTf67U0UvNqfc2QWEnLPHnGbskGRT7nL+2P6xMYkhoV6uBOfucXOwf5wljLsNik9mCT9VCgvJx/YFYYMGnlUYr8Vvtm6dRyvrubytv1JZpqONvyKtYVe9MhdkNEQeUp7lWn+Nx1VLbt6KyThI9Q7x/+GSE78z3rI8whzrjfOuMfBqNIpYl4bzSKnXjtZyVcMVPgoHunT6/+9hm93qKEsJE/QUoxDuthI2QDdQn4IrtlWy/uGERGAdyr7eggAMjPmCuDshDhoA8nOUhV0owWZcllLeSNhks1o3w1mTOaWI2ARzTWR1jxpu1o0CgdRdZ8XMVdSJxxgpkK450j6oMnMTuaP2rrSQ/JfRtOZQrXZz9BIRSMdTzgEXHqu1DJM84adwrjBy6WhvnsoSRSxIIiAB0oNdK9a0cdSpQC+Drpo50+IjiUF/pra7oLKAX/9vLNRi+uHQsvjJnYIdz9MGJuZTw3IAa0ZtIzNnM+Tsacag+tQHVJnBvstnTEWct5srCAj+M1jTiIlOBP8HS/DtbTOTHd X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3834.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(136003)(396003)(39860400002)(376002)(366004)(6916009)(9786002)(54906003)(6666004)(316002)(83380400001)(86362001)(8676002)(26005)(426003)(186003)(66476007)(66946007)(2616005)(38100700001)(66556008)(107886003)(5660300002)(4326008)(9746002)(2906002)(478600001)(8936002)(36756003)(4216001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: vz1sSPvxDKJ9iUijrVYYDjK+lZnZd/7u+BjvtXQoVpd7aRqSnQKct7y2q98cqhu/KkVbsePiYsH1lb1mM3c7la8ImKyKumxeEsHYzNcIGrqWnJumegMj26m4CXENTk01+YvDHBn4gjY4Jaz+8twtVLkwbcBmV556rndmTUUN7l/1YSNSmY9mxmP3ejKjiOEjVkKTfXO6lr/ncIfwq9g+499C6NCry68MGy2ZYTe1NI95gkt45q5heI+560TEqIjBWYfnAlMy2BYaiGiL3k7+pMbmYssHLFbcAm/Q1N0tWFdMwn7crRwfv1ooJWVX+72ro576taIhHCKP0BvfnW/JU6n5uUA2cXiAvqy1yyqtkM65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5c X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3834.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2021 19:40:44.3477 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9NOH6pqMxqIh0m2pY7+gUC5x1Lvujvfub89N+AFG+0GwUJ9wieQPji3f2I15gk5i X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3515 Precedence: bulk List-ID: <kvm.vger.kernel.org> X-Mailing-List: kvm@vger.kernel.org |
Series |
Make vfio_mdev type safe
|
expand
|
diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index f7559835b0610f..4caedb3d4fbf32 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -258,7 +258,9 @@ int mdev_device_create(struct mdev_type *type, const guid_t *uuid) list_add(&mdev->next, &mdev_list); mutex_unlock(&mdev_list_lock); - dev_set_name(&mdev->dev, "%pUl", uuid); + ret = dev_set_name(&mdev->dev, "%pUl", uuid); + if (ret) + goto out_put_device; /* Check if parent unregistration has started */ if (!down_read_trylock(&parent->unreg_sem)) {