From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1904019F467 for ; Tue, 1 Oct 2024 09:42:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727775757; cv=none; b=KBuOFJSa896ElHPfC3jmEIli91gcosAptMXs9bcddZFU9SBWlvrxdP/hJGTcA2ijrPWx17VZkaRFo/o8H4+TaJPx7W5jQkeJw+PJHs5gFRAFcfgu30Vvrg4f4rK0rEFkVh0aoA+auruU6IRXdwzNoZgL/aoO8ws/zEId89751Kg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727775757; c=relaxed/simple; bh=z+pSxNv5hnOhllS2CICUxp4i6tzCeCDi8iI0bwODrgg=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=JLpOJXFL9S/gTXMTqEpFAAqLo4VpkshvftnVJwpj01lA45c/hjZUqIkJ7OPlB/jJEecrRzlbrjuCkpcTqofmT3aDexnIw0QWSiNH9qiCj8JOwhvswx66uCgDbajRsDN5U6qNsupUP5hf2UlODcqNuKEmXUz0vz77lW3E9jQ/kW8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OPdA5jiy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="OPdA5jiy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94E09C4CED1; Tue, 1 Oct 2024 09:42:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727775757; bh=z+pSxNv5hnOhllS2CICUxp4i6tzCeCDi8iI0bwODrgg=; h=Subject:To:Cc:From:Date:From; b=OPdA5jiymLXjt9NMAsUwWB3EUirSdio2i2xOfopcKkZbtSTumV+hRxwK7AeNEmfRI xaNt9D4NwiIJMZ0fE15vZarSjeqsi2YbzMGtao3iq6YeABYbxPtvw5Z2kCyV7upWZ1 xKNScqNwxjSaiQJvFvA2L3jmT6Odw2I6Eb9fPPg4= Subject: FAILED: patch "[PATCH] soc: versatile: realview: fix soc_dev leak during device" failed to apply to 5.4-stable tree To: krzysztof.kozlowski@linaro.org,linus.walleij@linaro.org Cc: From: Date: Tue, 01 Oct 2024 11:42:19 +0200 Message-ID: <2024100119-lather-concept-f5c2@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y git checkout FETCH_HEAD git cherry-pick -x c774f2564c0086c23f5269fd4691f233756bf075 # git commit -s git send-email --to '' --in-reply-to '2024100119-lather-concept-f5c2@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^.. Possible dependencies: c774f2564c00 ("soc: versatile: realview: fix soc_dev leak during device remove") 1c4f26a41f9d ("soc: versatile: realview: fix memory leak during device remove") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From c774f2564c0086c23f5269fd4691f233756bf075 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sun, 25 Aug 2024 20:05:24 +0200 Subject: [PATCH] soc: versatile: realview: fix soc_dev leak during device remove If device is unbound, the soc_dev should be unregistered to prevent memory leak. Fixes: a2974c9c1f83 ("soc: add driver for the ARM RealView") Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/20240825-soc-dev-fixes-v1-3-ff4b35abed83@linaro.org Signed-off-by: Linus Walleij diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c index d304ee69287a..cf91abe07d38 100644 --- a/drivers/soc/versatile/soc-realview.c +++ b/drivers/soc/versatile/soc-realview.c @@ -4,6 +4,7 @@ * * Author: Linus Walleij */ +#include #include #include #include @@ -81,6 +82,13 @@ static struct attribute *realview_attrs[] = { ATTRIBUTE_GROUPS(realview); +static void realview_soc_socdev_release(void *data) +{ + struct soc_device *soc_dev = data; + + soc_device_unregister(soc_dev); +} + static int realview_soc_probe(struct platform_device *pdev) { struct regmap *syscon_regmap; @@ -109,6 +117,11 @@ static int realview_soc_probe(struct platform_device *pdev) if (IS_ERR(soc_dev)) return -ENODEV; + ret = devm_add_action_or_reset(&pdev->dev, realview_soc_socdev_release, + soc_dev); + if (ret) + return ret; + ret = regmap_read(syscon_regmap, REALVIEW_SYS_ID_OFFSET, &realview_coreid); if (ret)