Received: by 10.223.164.202 with SMTP id h10csp774365wrb; Thu, 23 Nov 2017 06:05:17 -0800 (PST) X-Google-Smtp-Source: AGs4zMYO6lfP3BvPmZj77D2MixJtJ6HY/MMstBVxiCqOAX6mmQSFvTH+ERK9hEK+7134Ms224Sli X-Received: by 10.98.63.16 with SMTP id m16mr23306857pfa.218.1511445917825; Thu, 23 Nov 2017 06:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511445917; cv=none; d=google.com; s=arc-20160816; b=dkDp/asrfegws5IyThnq2lhKSlrvX5j/j6M0SNVPTaMtHh9oFxjWzmbMd3kwWX5yAd 6Ab1ABDuU3B29SSVU+fP6QelB5ujAIzvJJhdbwdcUJmtDtk9kte6oa+QAy/+2/7LYNZe oP4Xkns8n43FMW/zOJHLGhuxyzwHDShnhviCA2x/QM6uZLMz/vzFasQLIylxSEpEN9Ed ckD9aq7ZRgLrYr5lraZH8QT1TUI8ZUf9WaiV9GV2pE1u5/kh4EB8KbsVSIlizBPtda8o jkr37d8JPzBYsv+XUIXIPl3jGwX+xHsWZEb8s1O902oQQSmwpQ5OHTiRmN0xjeMD6bCE Y5+g== 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:message-id:date:subject:cc:to:from :arc-authentication-results; bh=E/2zNZQlsCP/vO3D5QupVXFMeg1lLbgUnAYPvJVIC0Y=; b=pTgJF4FXVdT0dKLuEjyUJgGsn899iXKplGaLH0oiwL3/u9AKuknKrMkKJyh27NK9+X L5QwxQu7E71wZUgZU63V22qNkDIC3CFDOeD7Qgs2WUpHAz4jmjWjCtOH5Zeer+NOWf+2 U04IK1fkV7sZdJnFCK4a94TN922BsadPyVzrt2k8oPrWP0fST1tcyWb/IF9aqTpcCLS9 1Rg5jlFX9VWxJNkBD6mTkktdvG0JR29fe+iDy8PMJRkXMnkb2Vc73k+yYBb8H+sLAu4D a5Z1Tbe2ctgXMg1E0oTRZO+finISfN54uOld/Kp3i2a2ox/hTeFb7NubS882+M5OoseM 3Xdw== 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 y81si17622642pfb.21.2017.11.23.06.05.06; Thu, 23 Nov 2017 06:05:17 -0800 (PST) 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 S1753086AbdKWOCW (ORCPT + 75 others); Thu, 23 Nov 2017 09:02:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46374 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753056AbdKWOCV (ORCPT ); Thu, 23 Nov 2017 09:02:21 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E869D80C14; Thu, 23 Nov 2017 14:02:20 +0000 (UTC) Received: from localhost (ovpn-112-71.ams2.redhat.com [10.36.112.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0FC063742; Thu, 23 Nov 2017 14:02:12 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: linux-kernel@vger.kernel.org Cc: somlo@cmu.edu, xiaolong.ye@intel.com, qemu-devel@nongnu.org, mst@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v8 1/5] fw_cfg: fix driver remove Date: Thu, 23 Nov 2017 15:02:02 +0100 Message-Id: <20171123140206.3911-2-marcandre.lureau@redhat.com> In-Reply-To: <20171123140206.3911-1-marcandre.lureau@redhat.com> References: <20171123140206.3911-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 23 Nov 2017 14:02:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On driver remove(), all objects created during probe() should be removed, but sysfs qemu_fw_cfg/rev file was left. Also reorder functions to match probe() error cleanup code. Signed-off-by: Marc-André Lureau --- drivers/firmware/qemu_fw_cfg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 5cfe39f7a45f..deb483064f53 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -582,9 +582,10 @@ static int fw_cfg_sysfs_remove(struct platform_device *pdev) { pr_debug("fw_cfg: unloading.\n"); fw_cfg_sysfs_cache_cleanup(); + sysfs_remove_file(fw_cfg_top_ko, &fw_cfg_rev_attr.attr); + fw_cfg_io_cleanup(); fw_cfg_kset_unregister_recursive(fw_cfg_fname_kset); fw_cfg_kobj_cleanup(fw_cfg_sel_ko); - fw_cfg_io_cleanup(); return 0; } -- 2.15.0.277.ga3d2ad2c43 From 1590176825759334977@xxx Sun Jan 21 04:59:57 +0000 2018 X-GM-THRID: 1582578719977855403 X-Gmail-Labels: Inbox,Category Forums,Downloaded_2018-01