Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751387AbdFYV3B (ORCPT ); Sun, 25 Jun 2017 17:29:01 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:35081 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358AbdFYV3A (ORCPT ); Sun, 25 Jun 2017 17:29:00 -0400 Date: Sun, 25 Jun 2017 14:28:56 -0700 From: Bjorn Andersson To: Suman Anna Cc: Henri Roosen , ohad@wizery.com, linux-remoteproc@vger.kernel.org, open list Subject: Re: [PATCH] rpmsg: Release rpmsg devices in backends Message-ID: <20170625212856.GE26155@builder> References: <4955fa27-2daf-b80f-c37f-35489c63b599@ginzinger.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 912 Lines: 26 On Fri 02 Jun 17:28 PDT 2017, Suman Anna wrote: > Hi Bjorn, > > On 06/02/2017 05:07 AM, Henri Roosen wrote: > > My suggestion would be to additionally change/fix > > rpmsg_register_device() so it will not overwrite the release callback. [..] > FWIW, I didn't run into any rpmsg device memory leaks even without this > patch with booting and shutting down of remoteproc devices. The > virtio_rpmsg_channel structure inherits the struct rpmsg_device and is > the one that gets allocated, and the release function plugged in > rpmsg_release_device is operating on the rpmsg_device pointer, but both > are actually the same pointer. > > Did you run into any memory leaks that required you to have this patch? > I did not see any memory leaks, because it happens that the pointers are the same in all current cases. But the code is wrong and should be fixed, thanks for pointing this out Henri! Regards, Bjorn