Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3151869img; Mon, 25 Mar 2019 04:59:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyV7SwBT0aFr41nDTW/2yBAtlriWcsYXDzrkuu1oa3lXxuG4D70sm9aF5tI+MSjOFQ32okM X-Received: by 2002:a17:902:be18:: with SMTP id r24mr2262454pls.69.1553515178321; Mon, 25 Mar 2019 04:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553515178; cv=none; d=google.com; s=arc-20160816; b=FoEMO/muKPXaJMfJkImMxCpoJdWuKE4VbRjeoajjMoJC9z4FwR0I6Y5aHVxtLURrPu PIclBXsEroL2g3DDzuJYTluN+kLARaQUjaU1PRhAZFc6buzu8IxqkqsyGZOGM4qSND7g VwGnLXXmFZCyuubMm5WeeV9WD3uk8MGGNU9rTlu/BUIplqf4c8Hh5fNU+LHmnZKG8hne 1SgRKW+J6IZqqoISt352h6pSJfO9ThP5+5512sesQ7nRNn0RKf8MTmc+L9DFXKYHtJSu copWeFYP3DI3wy1dYnIhn7hEUc6DGE3kV/gvQ9Mm+77lfdYv8jfcCaAvecsAvTbmJORK 3ijA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:to:from:subject:message-id; bh=46QLdXuXUawhLMe8ARQRfzhnRjpA6o5biL42yw6oD/Q=; b=JtR6LkBTBN0fH8CXuqc4IrtJU0Xf69noZAarFOY+nlDKoE5AjyWGPBJm4nlddq88B0 vjmhQnitcT+xyqJWf7WG7dNFFd7CkLzfDtfWC1MVi5A92LQDdzTZLbe1i6/K3FYrD8Aj YrN0r0Aye7j986QEe8qOToZ9hCDcbwNLWN0aaow563dU140+TcEjDb8LkVh9qBlNoanv HkQtj8cD5rN5ghJ3FsRAQ5P8GQeNDZ7z3wcrmpisaLL0sL8WzvHHGRJjjpQ8ksld5LfN Cxe8c4gIOhGSzvWYbGbPDv8iW458wuzkUJUGJlTHNHYq/jI9B6B7++oFCdcpayV1Yry8 I8hw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h131si13023910pgc.442.2019.03.25.04.59.23; Mon, 25 Mar 2019 04:59:38 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731070AbfCYL6I (ORCPT + 99 others); Mon, 25 Mar 2019 07:58:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39764 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730899AbfCYL6I (ORCPT ); Mon, 25 Mar 2019 07:58:08 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 29821C066453; Mon, 25 Mar 2019 11:58:08 +0000 (UTC) Received: from maximlenovopc.usersys.redhat.com (unknown [10.35.206.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B80E76F62; Mon, 25 Mar 2019 11:58:04 +0000 (UTC) Message-ID: Subject: Re: [PATCH 6/8] vfio/mdev: Follow correct remove sequence From: Maxim Levitsky To: Parav Pandit , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kwankhede@nvidia.com, alex.williamson@redhat.com Date: Mon, 25 Mar 2019 13:58:03 +0200 In-Reply-To: <1553296835-37522-7-git-send-email-parav@mellanox.com> References: <1553296835-37522-1-git-send-email-parav@mellanox.com> <1553296835-37522-7-git-send-email-parav@mellanox.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 25 Mar 2019 11:58:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-03-22 at 18:20 -0500, Parav Pandit wrote: > 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); > } I agree with that. Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky