Linux kernel staging patches
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Cong Nguyen <congnt264@gmail.com>
Cc: Martyn Welch <martyn.welch@gefanuc.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: vme_user: fix flush_image leak in tsi148 bridge
Date: Thu, 13 Aug 2026 21:16:23 +0900	[thread overview]
Message-ID: <2026081359-gloss-brownnose-9846@gregkh> (raw)
In-Reply-To: <20260813121057.2590433-1-congnt264@gmail.com>

On Thu, Aug 13, 2026 at 07:10:57PM +0700, Cong Nguyen wrote:
> When error checking is enabled (err_chk=1), tsi148_probe() allocates an
> extra master window resource, tsi148_device->flush_image, which is used
> to flush posted writes by reading back over the VME bus. Unlike the
> regular master windows, this resource is not linked into
> tsi148_bridge->master_resources.
> 
> Because it is not on any resource list, it is freed neither by the probe
> error path (which only walks the master_resources list) nor by
> tsi148_remove(), so it is leaked whenever err_chk is set and either
> probe fails after the allocation or the device is unbound / the module
> is unloaded.
> 
> Free flush_image in both the probe error path and tsi148_remove(). This
> is safe when err_chk is disabled: tsi148_device is allocated with
> kzalloc() so flush_image is NULL and kfree(NULL) is a no-op.
> 
> Fixes: d22b8ed9a3b0 ("Staging: vme: add Tundra TSI148 VME-PCI Bridge driver")
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-opus-4
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
> ---
> Changes in v2:
> - Add Assisted-by: tag (Greg Kroah-Hartman). No code changes.

You have read this:
	https://lore.kernel.org/all/2026080354-skater-urgent-31b2@gregkh/T/#u
right?

If not, please do so.

thanks,

greg k-h

  reply	other threads:[~2026-08-13 12:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 12:10 [PATCH v2] staging: vme_user: fix flush_image leak in tsi148 bridge Cong Nguyen
2026-08-13 12:16 ` Greg Kroah-Hartman [this message]
2026-08-13 12:54   ` Nguyễn Công

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=2026081359-gloss-brownnose-9846@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=congnt264@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martyn.welch@gefanuc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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