From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796292578; b=z5VrWcY3o0lZEziWBuaHKChm/CvVFrB/yesX9UMtW3wDkGz3YUgrDUB0SlYSthLhweJc vh0Cda2Pwoh/xHpqrN6jUvQ9LYzdbqbgoIjvZQbtgyReueZ6HdELWKipEPtq+swY1AYAo sKIfclw4gQhBn3uFUZUh7plNPDp1YUG0T6c0qR+Rsfl3/I57m1idTLwj7oSTQ6p16SjK2 jJZ/90CmSD5kTErLvcBMqdl9LxqYN2D69PWWMrrfG3rIsuL+N+OSyx1U8gP458+1w627H 2ZlHN6DjPFvaqCD9fAoxOHdAuzp/tzGZJhn4EdbycXmF3JRADdhf8FD2l7F1vqecsvA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796292578; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=EilmpMwLLkmrSR+jUhhPTjdKc7e23si1dAfhW50OLrk=; b=SGDdczHclBD3EfvG1kaB8jFkIgLRsLIgCC4zxdyeSfY1vF47KopYDo8fePOgiH499+tV 6HyqGacfuZP3wntQjxUkumgh8a9wppfEGRb4xJ9LmJ/AnaxS0gJ8UVUPnElofH1e0HfWM QghUEVulRUvSks3p+LKfdcLW1hbXN2BB6nqEDazmBO5LLO6yFzchrGdN2WepmkqNWCU2h A8Wt+yWdMykZtHZgtej0bw3xd1WLIhlW/aOvwlAv4KuPPzqWOb2v5grg+SLCadqMCcY1c 6JOIoKQDXe4uknUD4pzHFXzI5oriqB/jNJnU1cSB9UWumVJEUaXJaT42+oX82BkJ5Rg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=e4yezX1X; arc=none smtp.remote-ip=74.125.82.48 Received: from mail-dl1-f48.google.com (mail-dl1-f48.google.com [74.125.82.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 250B6606A322 for ; Thu, 3 Dec 2026 10:09:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 250B6606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=e4yezX1X Received: by mail-dl1-f48.google.com with SMTP id a92af1059eb24-1b5b93bdc2dso6172508c88.0 for ; Thu, 03 Dec 2026 02:09:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796292577; x=1796897377; darn=vger.kernel.org; h=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=EilmpMwLLkmrSR+jUhhPTjdKc7e23si1dAfhW50OLrk=; b=e4yezX1XJ10Z7N59sXnxPcb8lG1p6O/JM7a9eBFDK+yA5EexCVy8W7rPYD4uihW2xv q7KpM0MoX60deFv7uSIV8TuA8qeREIbwdWMb7YjNoksvwVQa6h2wj/a6qTtKYqdnWSKO q3wFizI4WGHfEn4gQyjZmMfzdStv30YBm9hpwIi9ah6tZRtx6OdeOy+nSLEV4cfUMVEt VXmxtz0VwxWxO4jGmGvSkwrCPde0xXbE4rCTsQ36D2gmzZnMCIeOKwxUScdy7z4sjngM 7ZP8WRmykHtvN5jEFBENiEqC9VDNG7DkAF/VpmnCN7B8KQtxM9Sq0OasrNzdDubY376B IaQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796292577; x=1796897377; h=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=EilmpMwLLkmrSR+jUhhPTjdKc7e23si1dAfhW50OLrk=; b=ja7tIVS//0aMffdSe3HAglYemzhDfj0Uwb1llKgrzfvJE/ibASEumJnUqCzLEOrZHq gRnGZCe9zC2Isbg/vVjaltrFVdDfam8H4WFcui/+ydQ6dhulg6MoZnSm8tEucnCA0Pci +bP1RZfPZVd1zGKbrmKJbfQzDjYc0eBdo58QT04utKplKaIJYpAqIwmcuDcMv9DtZhVi Bc+Lt2yEA6EgSzLANzLcm/Mz7XwcR2KGqzvHJm5mYlkuEw5Jg7+6xNVEpVYewy0CF7Tj yL1Dycy7f+f6iuYAvFJZriS6XtCtza+Rp3nXYCieIpYes/YA5BmZ2+wAhNlnZHAFVQKs HqEw== X-Forwarded-Encrypted: i=1; AL+hErEEnHh0JnUiYIf6VyPvzvyJlHQiSH0EFxaS8e6NBJ7O4YKomETmZl+oC+Qr4pUeC6jq5vZb51sdlt060R0=@vger.kernel.org X-Gm-Message-State: APuU4Z9OBWdpxy8dimleOnluP/GFFUtk/PTnoiRfc0yRPV+NW2r3PotV mHl7eVKWw2mG6W2XSPpq8jS85MtbpKHVbJRG83Xtez3G6setNoBagymFYZke5n0O8yg= X-Gm-Gg: AZFdTZf9IpQ0+bE7SZ+q1IRjf9FldCvuk+oq5kYijBSTI/OMAoCiYxUSdeIm1SfmfqR 2Imwmm1HTUMBdXAHbrh8ZnCq1afUvkd5t+c4MU0cq1Q6wjMgmuL/HvSlcjyNunXXoheL/HQGFPK eZwqtxUJRH5VLRob5sY6yCMFjx7jIf52R9YFc8Ebb6O5M+7hmvFR8EPgKkIwgxNf+DImDkTz9cL ubPOufCp7Yb6yNG5/3EUg6CSjwebPbIgM7ofebNbJcVoWRJaR/RYEujAfegWzVPno7e9PCNMoX7 BZRSNDyOpjJDz17e3D1itlXrZFJEwGg+iaskYnyFMWp4hUMBARuzOSI+CH/ncEDUyhtHu8MYuGl IBHaQq2yXQ6TqX1+i8ypTbj8HucQ3VLDVoYJD6h+qrRyOOqjbcqFBRMoF1fhGulB0ASSE5NnL0K /RNN3cEZtXdxVnKC0VhH49AfweO5A1E7VmSIg2oohipa/+w/SIGf7v/9o9AE52SaCks4nwZBnVY zY/1x/4Ju2l1NgrV7XTmDOejNG3kI7QKTtk2/DZr/Yfwr8Ldfdem2wEBn0PtIdekiILe972hhQF keISODgeIANsLBEaNTg4/h+NUMcUQ2PoBxNR2jTBxPrTy3imag== X-Received: by 2002:a05:7022:e0b:b0:1a3:8d5f:6f93 with SMTP id a92af1059eb24-1b556882ac7mr61938868c88.17.1796292576713; Thu, 03 Dec 2026 02:09:36 -0800 (PST) Received: from localhost ([122.172.83.31]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b556840494sm100618681c88.12.2026.12.03.02.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 02:09:35 -0800 (PST) Date: Thu, 3 Dec 2026 15:39:33 +0530 From: Viresh Kumar To: Bilal Hashim Cc: "Rafael J. Wysocki" , Zhongqiu Han , Miguel Ojeda , Alice Ryhl , linux-pm@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] rust: opp: clone cpumask before adding OF table in from_of_cpumask() Message-ID: References: <179604464473.13032.3572169864639839233@126.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <179604464473.13032.3572169864639839233@126.com> On 30-11-26, 21:17, Bilal Hashim wrote: > In Table::from_of_cpumask(), CpumaskVar::try_clone(cpumask) is currently > called after bindings::dev_pm_opp_of_cpumask_add_table() succeeds. If > the cpumask allocation fails, Table is dropped before table.cpus is set, > so Drop does not call dev_pm_opp_of_cpumask_remove_table() and the > C-side cpumask OPP table is leaked. > > Clone the cpumask before calling dev_pm_opp_of_cpumask_add_table() so > that an allocation failure returns cleanly without leaking the OPP > table. > > Fixes: d52c7e868fbc ("rust: opp: Add abstractions for the OPP table") > Signed-off-by: Bilal Hashim > --- > Changes in v2: > - Drop the unreachable Self::from_dev() error rollback hunks in > Table::from_of() and Table::from_of_cpumask() and keep only the > CpumaskVar::try_clone() move (thanks to Zhongqiu Han). > - Update commit message and add Fixes: tag. > --- > rust/kernel/opp.rs | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Applied. Thanks. -- viresh