From patchwork Sun Jun 25 22:05:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 9808461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 683D06088A for ; Sun, 25 Jun 2017 22:05:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45D3D283B0 for ; Sun, 25 Jun 2017 22:05:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AA49283C5; Sun, 25 Jun 2017 22:05:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58E45283B0 for ; Sun, 25 Jun 2017 22:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751419AbdFYWFW (ORCPT ); Sun, 25 Jun 2017 18:05:22 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:36604 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408AbdFYWFU (ORCPT ); Sun, 25 Jun 2017 18:05:20 -0400 Received: by mail-pf0-f174.google.com with SMTP id q86so46327078pfl.3 for ; Sun, 25 Jun 2017 15:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=TmM8jeJhuZVj30mgsDXS0WMPG9nceTqTGmQBReWy+zQ=; b=BOPW+PYPryaiM6D/ErkujuGyqbN131yHu4D3jSunQp1aO8WqanbdmGYbzsc1QlfzSX bnwYnKjL2QW2gpC9/G6vEKYR+8Qzi3tqUtDID1w1LzUjMQ3lbpv/Kk8Bnf8DsHG6YTbJ xAQYB7ckryhgk/6xBmeGZc0qmouqx30PCM/To= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TmM8jeJhuZVj30mgsDXS0WMPG9nceTqTGmQBReWy+zQ=; b=e9FpZGQmXwNTz8uqE8PAuO6/BTZNrQZ2Q7cpbObvlvO5vpZRayZWKftGgCszZ510yq JpuAiY9B8Ih8CA7bnX5bEBqrgWamJDIpRW2dyjU4LeNsiYoF4we1W5Uu7MBc8wYpGfsN sONqSIsHjVmkE1KcHF6ZWjWCHjtrwZHlTGZR+dQiUILz4Za/8cSBLb/97uhGvjHCRqoH YS4ILVirt/MwWDj6tQ2k6beH1Et19wj894KiQ1J73Ka6e/EIOC70bnCjWYNtiWdzYk3B dseiYUnHZFeTNsYcVupQ37jVYjg57d/DKED1SfQcoWif9quOb5dHJc9lifUA5wQ7HjB+ RjIQ== X-Gm-Message-State: AKS2vOwj3YYXNORMna8PNVJMWhOir8EI9m+mkb/2Dm49FRT1h2NQHv38 O1L3KwjDGPC0rAt6 X-Received: by 10.84.128.46 with SMTP id 43mr3285809pla.113.1498428319619; Sun, 25 Jun 2017 15:05:19 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id 70sm22643755pft.104.2017.06.25.15.05.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Jun 2017 15:05:18 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Henri Roosen Subject: [PATCH] rpmsg: Don't overwrite release op of rpdev Date: Sun, 25 Jun 2017 15:05:15 -0700 Message-Id: <20170625220515.4061-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP b0b03b811963 ("rpmsg: Release rpmsg devices in backends") attempted to correct the ownership of freeing rpmsg device memory. But the patch is not complete, in that the rpmsg core will overwrite the release op as the device is being registered. Fixes: b0b03b811963 ("rpmsg: Release rpmsg devices in backends") Reported-by: Henri Roosen Signed-off-by: Bjorn Andersson --- drivers/rpmsg/rpmsg_core.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index 600f5f9f7431..c89edaf6133b 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -461,13 +461,6 @@ static struct bus_type rpmsg_bus = { .remove = rpmsg_dev_remove, }; -static void rpmsg_release_device(struct device *dev) -{ - struct rpmsg_device *rpdev = to_rpmsg_device(dev); - - kfree(rpdev); -} - int rpmsg_register_device(struct rpmsg_device *rpdev) { struct device *dev = &rpdev->dev; @@ -477,7 +470,6 @@ int rpmsg_register_device(struct rpmsg_device *rpdev) rpdev->id.name, rpdev->src, rpdev->dst); rpdev->dev.bus = &rpmsg_bus; - rpdev->dev.release = rpmsg_release_device; ret = device_register(&rpdev->dev); if (ret) {