Received: by 10.223.164.202 with SMTP id h10csp3607044wrb; Mon, 20 Nov 2017 01:56:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMY0Cvga/vvbs7HaUV8LLev+63tEyEM88f8t+8qowDrXId931fPj/ZT/bDJagazpFedeGBGZ X-Received: by 10.84.137.129 with SMTP id 1mr13433287pln.67.1511171797334; Mon, 20 Nov 2017 01:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511171797; cv=none; d=google.com; s=arc-20160816; b=tkgeZritkBoy19h7aJu1QdxLVamYi/2ADoETV9aSzC5jXOwUo9OkzjaATPLq8ix6z2 fc1er9SG35StoWarwcasVZnI4Rk2TD3OdNRsVOm5HMhzHwu2YUyUZkqCe8tw33mrkBo8 ItjSd+Nq0hLT86FIUCmULr6WHBgAsIYDCuPVhBJhgon1ghoz6JOZ5lws8Llr1Lzc+za8 s9jluCouFuhhd0SWAShmH27JS9FjqK7WXbDPg4mFgTvCg7N+FaOGhrUbj8m3Che2INVz XjVe0IrmEsjHxL/PoqkDwyOq6CHpVd9/+Fo0QLVJICyeRAgL1UCqyzPkAysOX34Y3uFF WoEg== 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=B9tOrWDeaN7xYYRmc/T8nf4HL2LiYGfb4lHml6b/SGbBPdj0taX17z6ev4fkH9zsx3 oayBww7GMZi+nT9zv7sqt5/nto1xwUjEFYuifqEVcnBeMC1q1zwd2FSchL45ARBPLg6W +VVgMQBMgvINvt+IREFcKRZdGHVOaXhwfsTpTnUTipcZ4U7MnnVtircJLAMisGkh0I0Y oGzU170pRgHev2ecsdbIM70Yvko72yX07p+NmhSu3ANIo19JaKoL7Uc57Pfj2Ws2CXMy kVGyiyR2KNojPcPMj7OlKm7hhALu8chxmzDj/9KEPBMI20UaLyVzc6IWO3ZdDQyu+LAG zH2w== 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 v5si7846878pgb.228.2017.11.20.01.56.27; Mon, 20 Nov 2017 01:56:37 -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 S1751210AbdKTJze (ORCPT + 68 others); Mon, 20 Nov 2017 04:55:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49422 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbdKTJzb (ORCPT ); Mon, 20 Nov 2017 04:55:31 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 522FB7EAA2; Mon, 20 Nov 2017 09:55:31 +0000 (UTC) Received: from localhost (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 853575D754; Mon, 20 Nov 2017 09:55:26 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: linux-kernel@vger.kernel.org Cc: qemu-devel@nongnu.org, somlo@cmu.edu, xiaolong.ye@intel.com, mst@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v7 1/5] fw_cfg: fix driver remove Date: Mon, 20 Nov 2017 10:55:15 +0100 Message-Id: <20171120095519.15214-2-marcandre.lureau@redhat.com> In-Reply-To: <20171120095519.15214-1-marcandre.lureau@redhat.com> References: <20171120095519.15214-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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 20 Nov 2017 09:55:31 +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 1584513966951098723@xxx Sun Nov 19 16:51:14 +0000 2017 X-GM-THRID: 1581553715797412419 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread