public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gupta, Nipun" <nipun.gupta@amd.com>
To: Prasanna Kumar T S M <ptsm@linux.microsoft.com>,
	nikhil.agarwal@amd.com, abhijit.gangurde@amd.com,
	puneet.gupta@amd.com, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 2/2] cdx: Fix double free when sysfs file creation fails
Date: Wed, 1 Apr 2026 15:12:04 +0530	[thread overview]
Message-ID: <c67594eb-7e3a-9fda-858a-a9ffa4e3d190@amd.com> (raw)
In-Reply-To: <20260320102117.1554548-1-ptsm@linux.microsoft.com>



On 20-03-2026 15:51, Prasanna Kumar T S M wrote:
> In cdx_create_res_attr(), if sysfs_create_bin_file() fails, the code
> frees res_attr but doesn't set cdx_dev->res_attr[num] to NULL. This
> leaves a dangling pointer in the array. Then cdx_destroy_res_attr()
> frees the already-freed memory. Fix the double free by initializing
> cdx_dev->res_attr[num] after sysfs_create_bin_file() completes.
> 
> Fixes: aeda33ab8160 ("cdx: create sysfs bin files for cdx resources")
> Cc: stable@vger.kernel.org
> Signed-off-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>

Acked-by: Nipun Gupta <nipun.gupta@amd.com>

  reply	other threads:[~2026-04-01  9:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 10:19 [PATCH 1/2] vfio/cdx: Fix NULL pointer dereference in interrupt trigger path Prasanna Kumar T S M
2026-03-20 10:21 ` [PATCH 2/2] cdx: Fix double free when sysfs file creation fails Prasanna Kumar T S M
2026-04-01  9:42   ` Gupta, Nipun [this message]
2026-04-01  9:41 ` [PATCH 1/2] vfio/cdx: Fix NULL pointer dereference in interrupt trigger path Gupta, Nipun
2026-04-01 18:22   ` Alex Williamson
2026-04-02  4:44     ` Prasanna Kumar T S M
2026-04-02 14:16       ` Alex Williamson
2026-04-06  4:18         ` Prasanna Kumar T S M

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=c67594eb-7e3a-9fda-858a-a9ffa4e3d190@amd.com \
    --to=nipun.gupta@amd.com \
    --cc=abhijit.gangurde@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikhil.agarwal@amd.com \
    --cc=ptsm@linux.microsoft.com \
    --cc=puneet.gupta@amd.com \
    --cc=stable@vger.kernel.org \
    /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