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: 106299 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1192250qgd; Sun, 25 Jun 2017 15:05:45 -0700 (PDT) X-Received: by 10.99.112.92 with SMTP id a28mr18617516pgn.151.1498428345448; Sun, 25 Jun 2017 15:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498428345; cv=none; d=google.com; s=arc-20160816; b=X7p7E1ykHpZbZfqmdyP1JATwsNr4QArOBWaxHhX9rNVa0hkrsOE0u0g4J5ijMjnJ+j oHyG2BtZmIaTGuj4tiRjvE3JfaboNw9k6aLroRWOfEn8FHHx4WInVAX29CnnEtvyWHoZ Tx73FRRplxLa6lclBeKoQBrTghBV+1kiDvvt7GUbxq+HCFIiTwnLDfmincErzHTvmsry WK6jd8QjE/cSOxodHjRcaTX8l6bYUcM6V9mnPmDUrvNW4B3g60wCtpG+zJMCNsbbp868 DFEKAghvJrdc9b8dWaDm4T9XkLHG+H2eiXGtJb4XpvJepWa1J7DLuXbViRDCBxbj+9b1 RYFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=TmM8jeJhuZVj30mgsDXS0WMPG9nceTqTGmQBReWy+zQ=; b=JwearDLzHEFJ+6Wi55NB4lK5AVZ0BVPdeR7M8mghbGCyyYIX8HNG5WN/qhfsHh7u/P tiRC1IsMwHeTYNKcXrsuCqma49jae0muIVRv5nfVTMspB/5nEWvG7nnFX4B+TaOT+VNM s3n3TEPapi8Nwyjaw6zNf4LmcyVYt7YBZU2Yer/Q/u5NoWWjGVbHa69sXrx0bJIj1v3X l3J4aSwVimckpZcvIPSBYhhJ4nTdEfEWC6IdNoNO8A5r99EDdZwFN0xVYr6q2/amHSE0 0nhhhYPavQiQEFnkpaSepozzzx4EPU0iO081Tc/roCKPyvqSJa4bLEZV+MUNEdyRjdP4 v+dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=BOPW+PYP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m66si7538760pfb.478.2017.06.25.15.05.45; Sun, 25 Jun 2017 15:05:45 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.b=BOPW+PYP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751488AbdFYWFX (ORCPT + 25 others); Sun, 25 Jun 2017 18:05:23 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:34164 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751349AbdFYWFU (ORCPT ); Sun, 25 Jun 2017 18:05:20 -0400 Received: by mail-pf0-f176.google.com with SMTP id s66so46320880pfs.1 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=bo7EcS3aiv4RPEBuq/BC05E3JcS+jS6Asa439pw26kCcB/7CcpywTHQ5Iin1j6Gkyp C8tAg74lNprY789lNU3IqlKiC/VXeWXix+ljus7gqBFDCzRpOhPcwfnwnDqDVROWGRDt FSOLZh0VVePbNuwr8RHUhIuzDFnQsFIkvoOGlfG960o9nkj2hq6Rh/u1v8OuRCl1huHe g1FPbDdtD10wiuRjS7C+S0y1TIsCEGII5eKbp+uUD+ApxrogNhT5u5wRbO8Pk2spDYgd yZIdP2qmQbUnaD/8HfvK3AUYIpxywRc/4LdCd6nz6u1zrormy3UOzk2K68tNSfOOtQEx mPgQ== X-Gm-Message-State: AKS2vOz85OgbBOcPiZsDK5plZjryBW7z6ZS4gY+iHvc1QnHOnyuHwN1t eKEayqHqcW1H/VFX 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.12.0 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) {