Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1118406img; Fri, 22 Mar 2019 16:22:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNmp6pbncRXuji0GzcxWRX5OiYzLdP3qi7X2EHyRr0wSnZD/eAP5qZoFl2X1OT61f8OhiS X-Received: by 2002:a17:902:8a84:: with SMTP id p4mr11965168plo.2.1553296953154; Fri, 22 Mar 2019 16:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553296953; cv=none; d=google.com; s=arc-20160816; b=XjvvqSr21x5By6KssMe7csjGAtP88TEj0cscndbGamqUmIi5Y+gJiyfcG8jmR9/gX7 s3lF+qreus8mhm21Tprf/EhXPYB6YgHP/qsn2aYQ68d9rPP2awAtEyAdG2qSZih/gN2o vEmE+RaFnZqXczOyHoM49B2wWOBCpXhNv8c6b/De2AUzoBPJlsNGxk+T1Bgr3UtLJmfQ hvBHV/EA+6uZv0vL9egM0z/jd+h96cA91YTA7+Xya00F2NuOmm7kxOobfPx060Kqi6Nz +K7tRbcK/m9diSdfhf0VSuG9FMoMhBrCfErp3rt4eJn+KUrE3ME1rUF65Tsi3R+Sj/3N zQTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=noQpYsAlJmfkhKUeM73fcpT/7CX/l0j4qhW7hyVqhEo=; b=hRQw9c79cY0WoX0Mlse1kkC9QMq0UAyOnZu16OXWibUzvD7UNPu0/OQpA42MoFWIVC u90xtHIP2/Mu+eaUwoeePq49Koy8kYN7+1KATuw4Lk6Dg8N7QOJQVt39S3jv/D81t4By cidfEWfnnNdqX6iL0lp/KvyQ4RSySloTJezntiOL6kx9bQBtlygWK2TuvKPADQi13oCG gkP24JS0h31F3PVVzlAe4X3UOCLhhqgHzMn+akP2MMkGv0xiX2nTYmIyEw7JMZHyXmmA eqnmPFxrS4U8iSfq8oo51dS8OXRbjfh6EiOGMkEqxbGc0qh/Faqc5YQTRmsbFiVTwiD3 23JQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj7si4685439plb.408.2019.03.22.16.22.17; Fri, 22 Mar 2019 16:22:33 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728534AbfCVXVA (ORCPT + 99 others); Fri, 22 Mar 2019 19:21:00 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:56836 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728511AbfCVXU7 (ORCPT ); Fri, 22 Mar 2019 19:20:59 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from parav@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Mar 2019 01:20:54 +0200 Received: from sw-mtx-036.mtx.labs.mlnx (sw-mtx-036.mtx.labs.mlnx [10.12.150.149]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x2MNKaw4007896; Sat, 23 Mar 2019 01:20:52 +0200 From: Parav Pandit To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kwankhede@nvidia.com, alex.williamson@redhat.com Cc: parav@mellanox.com Subject: [PATCH 6/8] vfio/mdev: Follow correct remove sequence Date: Fri, 22 Mar 2019 18:20:33 -0500 Message-Id: <1553296835-37522-7-git-send-email-parav@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1553296835-37522-1-git-send-email-parav@mellanox.com> References: <1553296835-37522-1-git-send-email-parav@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mdev_remove_sysfs_files() should follow exact mirror sequence of a create, similar to what is followed in error unwinding path of mdev_create_sysfs_files(). Fixes: 7b96953bc640 ("vfio: Mediated device Core driver") Signed-off-by: Parav Pandit --- drivers/vfio/mdev/mdev_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c index ce5dd21..c782fa9 100644 --- a/drivers/vfio/mdev/mdev_sysfs.c +++ b/drivers/vfio/mdev/mdev_sysfs.c @@ -280,7 +280,7 @@ int mdev_create_sysfs_files(struct device *dev, struct mdev_type *type) void mdev_remove_sysfs_files(struct device *dev, struct mdev_type *type) { + sysfs_remove_files(&dev->kobj, mdev_device_attrs); sysfs_remove_link(&dev->kobj, "mdev_type"); sysfs_remove_link(type->devices_kobj, dev_name(dev)); - sysfs_remove_files(&dev->kobj, mdev_device_attrs); } -- 1.8.3.1