From patchwork Tue Apr 26 06:05:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangyu Hua X-Patchwork-Id: 12826501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59F60C433F5 for ; Tue, 26 Apr 2022 06:06:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244693AbiDZGJW (ORCPT ); Tue, 26 Apr 2022 02:09:22 -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-Google-Smtp-Source: ABdhPJxXbBZxgeu7xrYCSXDIlP9axe93Bw7d99jH5yPRqTlr8/+YgL/jCjaFmLg7n5eMDE6dNxZofQ== 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 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@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)