From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A12A730DEB2 for ; Tue, 7 Jul 2026 14:48:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783435713; cv=none; b=ksz4rbgpbQtQKo92QNWwJ/LIUIxERPaR5Lwt3FoFbNli8qr2nRdPqMALWkP2bbkdHewstfN2TM/8tZcCtZpSGnZc2EbNVcSkLiw07Ok86eRTqlcAUC8WUQyA/KuLsy/4CpUb0J/1nu9LIEYLpPnGVfwNIMjKqpKE9mqMXIM5Xag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783435713; c=relaxed/simple; bh=Lsg4j5eFWvMqIbEJyOW2qo0hHFj3gbtonhvxLCJ8LwA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Kqc8cpYC76k+wqeXelscbb+pYDDBAQN5P0v8GxcrWs7uLXWuy3Zq8eX8ICDiT2xEq+Viq/tpD6N6VRieZygaWYtfSc+9AQ4idLecMAqMNqrxBasqYOFpA2jqGop6rU76FHQ4GxHnYH7CSrKI/fgdieloH7QNO+dtfcPAiQw4Rrk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VzD1POnF; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=k3aXMXrc; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VzD1POnF"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="k3aXMXrc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783435711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Drq9IO910KDKJg6IREG7IQQKNNio5SvfjReuxq/0qk0=; b=VzD1POnFW5OZi8ODFPNLGnViaYsF89+MagFD1VEbFRnm79+NNCvMvwCpduddj1s/wqeiHG bGEZK3c2LBkKjTUsPZQiqUfNQvNu6rLtK6Y0nXsQZ+cEuvzHFOkxOhuCRssmcETU8Yqcud uFTfeDi3n1BvDqrDPUpzRmD96L5hngM= Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-561-J6ZEyp0kMAWK-Jc0pbCG5Q-1; Tue, 07 Jul 2026 10:48:29 -0400 X-MC-Unique: J6ZEyp0kMAWK-Jc0pbCG5Q-1 X-Mimecast-MFC-AGG-ID: J6ZEyp0kMAWK-Jc0pbCG5Q_1783435709 Received: by mail-ot1-f70.google.com with SMTP id 46e09a7af769-7eb711362a2so2909077a34.1 for ; Tue, 07 Jul 2026 07:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1783435709; x=1784040509; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:content-type :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to:content-type; bh=Drq9IO910KDKJg6IREG7IQQKNNio5SvfjReuxq/0qk0=; b=k3aXMXrcd/shAsPRWPpcdGae/nQjSwSmaydE+WDllEByadAYGT4Dy1Yg2E1umcVJrw QQNYX120gHCGKheqHv0UIQNnSHbssuWk0Ie//3ckv6e+5W2IlxkpDoka3B11HCkTcjtZ q/4vR4Xz5pb7aKoWcxIg8ozeZ754DbCm5mZlKb3zoYdiYBGauRsOL+QDDT/WMWBYSr1T GuBwLJaXdytTq5x4rsf9psh4l82bHL2jZV2JXDTB5F9LRxM9RDuissuh4/Ta+4jdW431 ShkwGZgrEoSWDjrj0sUS9Nlz/G1Yokfg6/sc7TelhUbf8Qve8Rsbdw4CX1foe5srC291 uLMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783435709; x=1784040509; h=user-agent:in-reply-to:content-disposition:content-type :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Drq9IO910KDKJg6IREG7IQQKNNio5SvfjReuxq/0qk0=; b=nvwuEPc5xs5twi218IaBB2yWKbOVlNAUBM1215KlBftGCoP99cvMw+sAoaDRNi2t2P HEY45NAtGzqvdZYYMog27BH+5+knBINGcUuSmxOHlkmFhjxHJbR6LENuY3A6ERbX5UqS W835xXp8J2EAzcMig4o53IisllVCRlFBnTh9T2k5ObJD91awilg2t/gSq+CslUaRfT0Y zdKWgjr5x9C5Pr9j+XaKp0pO+3hUuMpz4/O2GuKUP9OHKdTv2bsiEz1yvjReENaKvoAu e10toQ14THTFAz9bk++VzRF5r5YHl6NcSZ3HohFPqAqfwlKp9JcLln1U1Qu5NKZ+v3VL Q3sQ== X-Forwarded-Encrypted: i=1; AFNElJ8ctPV8iROEc6kvlDzvla4YgA3bvpEFH10ldgh7pmsjz1/s8eIw7ND+zy3mC4Q6/+7jcTXRB+BGPffShDw=@vger.kernel.org X-Gm-Message-State: AOJu0YxYbo1wPYtqli8YUUKeMoEXll6d6O8NKLxhd8xIo+UTF+SvYzWa AF570nWlHGWayxHBYodDX6D7RFYo0xt+f+Ba5dVXVOUhu7IfcyyF2aFofLYr45wCvW6pVmLcFS8 SL1BOOGg5/wjarTC9MEVU1Z43qdQuTsiX09TEo7ij5YYRPPLiM0HQkOW1IsYXOWSqUpuOgiRYhw == X-Gm-Gg: AfdE7ckJMlxJ5GilazrNP3J9R6PXof/VqUWZQDfturh0YJ5+i2c/Lrd7x6yjwsXc0eb trZAKcaby4YwFpQAZS01WhHg6p9tuV/QcQjQQBzvteyuy1D+wL2TdM7CiGmXVNTF+QajJASWs7s chHLe16pK/Nqpe5/ngH55yVmm7j7VLdKq404NBpv+qTiSITd/F8lij+M9rO0qwIRJspw6LWc4N5 K+fQBx4EF6sz4Vy8yyIxbzroEg4Cctwv3lSAelbgxD7svgnz6kX65lrZc6M3LOISfPVdi3AjhOJ 00lJS7AqJ3sXMZbED6/BFwYqFPiFrOsV2Vn6aD6OeEyAdKUYspH2uUpfE2yopeMJc0hbp7eQ1zP 8emSpnGKs X-Received: by 2002:a05:6830:660a:b0:7e9:f0e6:fd55 with SMTP id 46e09a7af769-7ebb239d6a4mr3693035a34.30.1783435708669; Tue, 07 Jul 2026 07:48:28 -0700 (PDT) X-Received: by 2002:a05:6830:660a:b0:7e9:f0e6:fd55 with SMTP id 46e09a7af769-7ebb239d6a4mr3693021a34.30.1783435708164; Tue, 07 Jul 2026 07:48:28 -0700 (PDT) Received: from redhat.com ([2600:382:850a:55b4:731e:b0d4:e0cc:410]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7eb542936e6sm14104096a34.5.2026.07.07.07.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 07:48:27 -0700 (PDT) Date: Tue, 7 Jul 2026 10:48:24 -0400 From: Brian Masney To: Akari Tsuyukusa Cc: Michael Turquette , Stephen Boyd , Matthias Brugger , AngeloGioacchino Del Regno , "open list:COMMON CLK FRAMEWORK" , "open list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , stable@vger.kernel.org, Chen-Yu Tsai , Miles Chen Subject: Re: [PATCH v2 5/6] clk: mediatek: mt8173: fix memory leak on module removal Message-ID: References: <20260707074839.240676-1-akkun11.open@gmail.com> <20260707074839.240676-6-akkun11.open@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260707074839.240676-6-akkun11.open@gmail.com> User-Agent: Mutt/2.3.2 (2026-04-26) On Tue, Jul 07, 2026 at 04:48:34PM +0900, Akari Tsuyukusa wrote: > clk-mt8173-apmixedsys.c and clk-mt8173-infracfg.c do not call > platform_set_drvdata() during their driver probe callback, > but their remove callback calls platform_get_drvdata(). > This results in platform_get_drvdata() returning NULL, > which leads to calling kfree(NULL) in mtk_free_clk_data(NULL). > This leaves clk_data unreleased, causing a memory leak. > > Fix this by calling platform_set_drvdata() during probe. > > Fixes: 4c02c9af3cb9 ("clk: mediatek: mt8173: Break down clock drivers and allow module build") > Cc: stable@vger.kernel.org > Signed-off-by: Akari Tsuyukusa Reviewed-by: Brian Masney