public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Valery Borovsky <vebohr@gmail•com>
To: Will Deacon <will@kernel•org>
Cc: Mark Rutland <mark.rutland@arm•com>,
	Arnd Bergmann <arnd@arndb•de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
	Benson Leung <bleung@chromium•org>,
	Tzung-Bi Shih <tzungbi@kernel•org>,
	Guenter Roeck <groeck@chromium•org>,
	Miquel Raynal <miquel.raynal@bootlin•com>,
	Richard Weinberger <richard@nod•at>,
	Vignesh Raghavendra <vigneshr@ti•com>,
	Andy Shevchenko <andriy.shevchenko@linux•intel.com>,
	Linus Walleij <linusw@kernel•org>,
	Randy Dunlap <rdunlap@infradead•org>,
	linux-arm-kernel@lists•infradead.org,
	linux-perf-users@vger•kernel.org, linux-kernel@vger•kernel.org,
	chrome-platform@lists•linux.dev, linux-mtd@lists•infradead.org,
	Valery Borovsky <vebohr@gmail•com>
Subject: Re: [PATCH 1/5] perf/arm_pmu_acpi: fix reference leak in arm_pmu_acpi_probe error path
Date: Tue,  5 May 2026 13:36:27 +0300	[thread overview]
Message-ID: <inv007-withdrawal-vebohr@gmail.com> (raw)
In-Reply-To: <cover.1777889235.git.vebohr@gmail.com>

Yeah, you're right, my bad. The `arm_pmu_acpi.c` patch is definitely broken.

Since `spe_dev` and `trbe_dev` are statically allocated, they don't have a
`.dev.release` callback. If we hit `platform_device_put()` here, the refcount
drops to zero and triggers `device_release()`, which is going to scream about
the missing release function. At best, we get a messy WARN; at worst, it'll
panic the kernel if someone's running with `panic_on_warn`.

The kernel-doc note about `platform_device_put()` is really meant for dynamic
allocations where the release path actually frees memory. For static setups
like this, the original code is actually the right way to go.

Please drop patches 1/5 through 4/5 from the v1 series—they all suffer from
the same logic error. Patch 5/5 (mfd: sm501) is the only clean one, so I've
re-sent that as a standalone v2.

Sorry for the noise.

Valery Borovsky


      parent reply	other threads:[~2026-05-05 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1777889235.git.vebohr@gmail.com>
2026-05-04 10:08 ` [PATCH 4/5] perf: arm: pmu: fix reference leak on failed device registration Vastargazing
2026-05-05  8:50   ` Sudeep Holla
2026-05-05 10:36 ` Valery Borovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=inv007-withdrawal-vebohr@gmail.com \
    --to=vebohr@gmail$(echo .)com \
    --cc=andriy.shevchenko@linux$(echo .)intel.com \
    --cc=arnd@arndb$(echo .)de \
    --cc=bleung@chromium$(echo .)org \
    --cc=chrome-platform@lists$(echo .)linux.dev \
    --cc=gregkh@linuxfoundation$(echo .)org \
    --cc=groeck@chromium$(echo .)org \
    --cc=linusw@kernel$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mtd@lists$(echo .)infradead.org \
    --cc=linux-perf-users@vger$(echo .)kernel.org \
    --cc=mark.rutland@arm$(echo .)com \
    --cc=miquel.raynal@bootlin$(echo .)com \
    --cc=rdunlap@infradead$(echo .)org \
    --cc=richard@nod$(echo .)at \
    --cc=tzungbi@kernel$(echo .)org \
    --cc=vigneshr@ti$(echo .)com \
    --cc=will@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox