Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
  • * Re: [PATCH 1/5] perf/arm_pmu_acpi: fix reference leak in arm_pmu_acpi_probe error path
           [not found] <cover.1777889235.git.vebohr@gmail.com>
           [not found] ` <6717e0b2a6244ee4e691dba03eb8c790c202e89e.1777889235.git.vebohr@gmail.com>
    @ 2026-05-05 10:36 ` Valery Borovsky
      2026-05-06 15:43 ` [PATCH 3/5] mtd: maps: physmap-core: fix reference leak on failed device registration Valery Borovsky
      2 siblings, 0 replies; 3+ messages in thread
    From: Valery Borovsky @ 2026-05-05 10:36 UTC (permalink / raw)
      To: Will Deacon
      Cc: Mark Rutland, Arnd Bergmann, Greg Kroah-Hartman, Benson Leung,
    	Tzung-Bi Shih, Guenter Roeck, Miquel Raynal, Richard Weinberger,
    	Vignesh Raghavendra, Andy Shevchenko, Linus Walleij, Randy Dunlap,
    	linux-arm-kernel, linux-perf-users, linux-kernel, chrome-platform,
    	linux-mtd, Valery Borovsky
    
    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
    
    ______________________________________________________
    Linux MTD discussion mailing list
    http://lists.infradead.org/mailman/listinfo/linux-mtd/
    
    ^ permalink raw reply	[flat|nested] 3+ messages in thread
  • * Re: [PATCH 3/5] mtd: maps: physmap-core: fix reference leak on failed device registration
           [not found] <cover.1777889235.git.vebohr@gmail.com>
           [not found] ` <6717e0b2a6244ee4e691dba03eb8c790c202e89e.1777889235.git.vebohr@gmail.com>
      2026-05-05 10:36 ` [PATCH 1/5] perf/arm_pmu_acpi: fix reference leak in arm_pmu_acpi_probe error path Valery Borovsky
    @ 2026-05-06 15:43 ` Valery Borovsky
      2 siblings, 0 replies; 3+ messages in thread
    From: Valery Borovsky @ 2026-05-06 15:43 UTC (permalink / raw)
      To: Miquel Raynal
      Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel,
    	stable, Valery Borovsky
    
    Hi Miquel,
    
    Thanks for the review. I need to withdraw this patch as well, for the same
    reason as the rest of the series.
    
    `physmap_flash` is a static `platform_device` without a `.dev.release`
    callback. Using `platform_device_put()` triggers a `WARN` in
    `device_release()` when the kref hits zero, which is a dealbreaker for
    systems with `panic_on_warn=1`.
    
    The kernel-doc NOTE refers to dynamically allocated devices; for static
    ones, the original code is actually correct.
    
    I've already sent a withdrawal notice for the whole series (1/5-4/5) to
    the cover letter thread. Sorry for the noise.
    
    Best,
    Valery Borovsky
    
    ______________________________________________________
    Linux MTD discussion mailing list
    http://lists.infradead.org/mailman/listinfo/linux-mtd/
    
    ^ permalink raw reply	[flat|nested] 3+ messages in thread

  • end of thread, other threads:[~2026-05-06 15:43 UTC | newest]
    
    Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <cover.1777889235.git.vebohr@gmail.com>
         [not found] ` <6717e0b2a6244ee4e691dba03eb8c790c202e89e.1777889235.git.vebohr@gmail.com>
    2026-05-04 13:58   ` [PATCH 3/5] mtd: maps: physmap: fix reference leak on failed device registration Miquel Raynal
    2026-05-05 10:36 ` [PATCH 1/5] perf/arm_pmu_acpi: fix reference leak in arm_pmu_acpi_probe error path Valery Borovsky
    2026-05-06 15:43 ` [PATCH 3/5] mtd: maps: physmap-core: fix reference leak on failed device registration Valery Borovsky
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox