Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3373256ioa; Tue, 26 Apr 2022 02:13:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRtyRxCoWPfa3X7/FnFkSv5Ngv0WEF+gvmHZq6HzN+S5O8SeE7q95jBKGrIYhlwttqO411 X-Received: by 2002:a17:902:e548:b0:15d:26c3:852c with SMTP id n8-20020a170902e54800b0015d26c3852cmr5643304plf.34.1650964406183; Tue, 26 Apr 2022 02:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650964406; cv=none; d=google.com; s=arc-20160816; b=Klq4/XjBgyuKa/KS2irOLjmytpipkTSxdTVTJ+kv9uzy99EUq2iGY5ylVv3CUaefw0 Wn3kySOG1KF7FosYF40fAdGMsFYAxBEMTvWv3N9GbkpUmuOi2jJ7khSUyQh+MajpwsuA lczyfJlUWKbFlwEVIuFVYZUwXCiz4s/qra3yTjOB8+6smDsZ3E2uJFqaC638pC4Ft2xC lRf3FQEE4D6ZdakCPtNT6VyjCcmyAZv12+jHJ7jU0VQ/gLYO+fx1bunM5aveCzt1SLeD LuWAfCnS1r2MZN1eKLYZOG0tc8STNlq0ZXhLJ0pzg74WtygXqUBd6Bs2H01irMc6o3eT zIuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zxsx4ZKYAxOkMFzPKK0OLLsxMKegRk3fFS29nU34Sng=; b=vtaLSgylMmr6qi55cOS2h/f930HVONNTQ0pS1lVUXuWwE4KlrPVNAxXwQ8t/CIzRER Is1qEceNOciRbiIISALaq9G4vgkzWXmsVgonV2WINJHflqsIJ5v6BBLd/ld6u8IQIpuM UKlqptC/yciiEiZmgSNpue31JuE0K0QCwc28UEFL/UxaYMOs5oqEVJ0xEOjyBVYsa2ec ZGUfY11VpAozxcPRAYHDh/ZN2IP4/2QMpbEHIqso0RufUZiOzjBLtigI6kw0TnLrXRiU 7yRepbSDJCDUoWufVTbXqj5f4hB2LF2V9RVlKXyidgB+fH1dp52+lPG2SJS3lGpyVqh9 gb1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e24pDlaM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a63a74d000000b003816043f118si19850517pgo.781.2022.04.26.02.13.12; Tue, 26 Apr 2022 02:13:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e24pDlaM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244682AbiDZGJX (ORCPT + 99 others); Tue, 26 Apr 2022 02:09:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244731AbiDZGJV (ORCPT ); Tue, 26 Apr 2022 02:09:21 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60DE33CA5B; Mon, 25 Apr 2022 23:06:15 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id y14so16258848pfe.10; Mon, 25 Apr 2022 23:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zxsx4ZKYAxOkMFzPKK0OLLsxMKegRk3fFS29nU34Sng=; b=e24pDlaM+TWnZa8ggX7R5ojMhDcejDG5odEH9GhDu3UU+Q9/zxGz1EYxmrk3ieOaKz WuEZOFQdzU/Hq0B7cWKeZAoF7dkyauwDiGNphWRc8BI8DWtTF18Eu9DVIXIzE4287Lbu DsxzezPKoXc/Wrz/j6XofPpWYN8HFDeV2HJK74n87KtOfnqn1t6d6M5zl8VqUZzF5IUE nKPYjMSM///gFWuCKQ5wqcfwLjMqDhAo6Az+Gje+vPRQ4YqosfzJicBI4ig3GUXWwJSA 68QCzub5/q3hsnJsKOelPy6qWBI2Xw+xRzWZcUD3VIHxroWuNHzdYssyZiaajpWDMb8Z sKXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zxsx4ZKYAxOkMFzPKK0OLLsxMKegRk3fFS29nU34Sng=; b=v+D6wRcS+KpJ9my1TCWx8CRko+ohb7g8DvftmguxRDkpAaT74cagV2FE/GswFxmEqJ 0px/9SGUiVt4NoDVbPWdWCbYqcaKzIw4WkcyqGomQeXPjYmuAqKdEVNbvvQwv3seO8On HDtYtgxVtDkC08OwtTYUxDsS4WQeMidxJntWtfRdO91vrqVkHcVke+Gk59JPoXgmOUZ1 S0DudrUefz4YvzYVNchFECuhixtQfrcneJzahvRzroqvVdS6XdAP+QKrmyKgwsXh/a07 d7X+F5W7McG1zAa2BDi+tDCKSM915jLmoRII6k3P8SllDNjpkeQTxJCFKxfD6MZbc/vF MaqA== X-Gm-Message-State: AOAM533cNI/DiFfSMKx6gPFfOV6utaV7hyEYPjbnhaIOCHllfObsUspA si4gcCdtU9oCqHpyjSzVG0c= X-Received: by 2002:aa7:943b:0:b0:505:70bd:61ab with SMTP id y27-20020aa7943b000000b0050570bd61abmr22531815pfo.58.1650953174977; Mon, 25 Apr 2022 23:06:14 -0700 (PDT) Received: from localhost.localdomain ([103.84.139.165]) by smtp.gmail.com with ESMTPSA id k13-20020a056a00134d00b0050a5867dd73sm13969135pfu.157.2022.04.25.23.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 23:06:14 -0700 (PDT) From: Hangyu Hua To: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, arnaud.pouliquen@foss.st.com Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Hangyu Hua Subject: [PATCH v2 3/3] rpmsg: virtio: Fix the unregistration of the device rpmsg_ctrl Date: Tue, 26 Apr 2022 14:05:36 +0800 Message-Id: <20220426060536.15594-4-hbh25y@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220426060536.15594-1-hbh25y@gmail.com> References: <20220426060536.15594-1-hbh25y@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unregister the rpmsg_ctrl device instead of just freeing the the virtio_rpmsg_channel structure. This will properly unregister the device and call virtio_rpmsg_release_device() that frees the structure. Fixes: c486682ae1e2 ("rpmsg: virtio: Register the rpmsg_char device") Signed-off-by: Arnaud Pouliquen Cc: Hangyu Hua Reviewed-by: Hangyu Hua --- drivers/rpmsg/virtio_rpmsg_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 291fc1cfab7f..485e95f506df 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -862,7 +862,7 @@ static void rpmsg_virtio_del_ctrl_dev(struct rpmsg_device *rpdev_ctrl) { if (!rpdev_ctrl) return; - kfree(to_virtio_rpmsg_channel(rpdev_ctrl)); + device_unregister(&rpdev_ctrl->dev); } static int rpmsg_probe(struct virtio_device *vdev) -- 2.25.1