Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752407AbbBEVDd (ORCPT ); Thu, 5 Feb 2015 16:03:33 -0500 Received: from smtp.codeaurora.org ([198.145.11.231]:38725 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbbBEVDb (ORCPT ); Thu, 5 Feb 2015 16:03:31 -0500 Message-ID: <54D3DAA1.10803@codeaurora.org> Date: Thu, 05 Feb 2015 13:03:29 -0800 From: Stephen Boyd User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Alban Browaeys CC: Tomeu Vizoso , Mike Turquette , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] clk: Fix __clk_get access to already freed owner field. References: <1423160690-7853-1-git-send-email-prahal@yahoo.com> <54D3C4E0.80608@codeaurora.org> <1423168988.5723.38.camel@gmail.com> In-Reply-To: <1423168988.5723.38.camel@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1535 Lines: 41 On 02/05/15 12:43, Alban Browaeys wrote: > Le jeudi 05 février 2015 à 11:30 -0800, Stephen Boyd a écrit : > >>> Signed-off-by: Alban Browaeys >>> --- >>> drivers/clk/clk.c | 17 +++++++++-------- >>> 1 file changed, 9 insertions(+), 8 deletions(-) >>> >>> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c >>> index df94668..8f33722 100644 >>> --- a/drivers/clk/clk.c >>> +++ b/drivers/clk/clk.c >>> @@ -2485,15 +2485,18 @@ EXPORT_SYMBOL_GPL(clk_register); >>> */ >>> static void __clk_release(struct kref *ref) >>> { >>> - struct clk_core *clk = container_of(ref, struct clk_core, ref); >>> - int i = clk->num_parents; >>> + struct clk_core *core = container_of(ref, struct clk_core, ref); >>> + struct clk *clk = container_of(&core, struct clk, core); >> How does this work? struct clk_core doesn't have a struct clk inside it. >> > Seems I am confused. The aim is to get the clk struct from its core > field. If I cannot do that from within __clk_release , this fix is > doomed. > Thanks for the information. Can you please try the patch in this other thread[1]? I think you're seeing the same problem. [1] https://lkml.org/lkml/2015/2/5/595 -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/