[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d413619a-8218-4039-8efe-bf9274499de7@deltatee.com>
Date: Wed, 20 Aug 2025 10:09:30 -0600
From: Logan Gunthorpe <logang@...tatee.com>
To: Sungho Kim <sungho.kim@...iosa.ai>, bhelgaas@...gle.com
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI: p2pdma: Fix incorrect pointer usage in devm_kfree()
call
On 2025-08-20 04:57, Sungho Kim wrote:
> The error handling path in the P2P DMA resource setup function contains
> a bug in its `pgmap_free` label.
>
> Memory is allocated for the `p2p_pgmap` struct, and the pointer is stored
> in the `p2p_pgmap` variable. However, the error path attempts to call
> devm_kfree() using the `pgmap` variable, which is a pointer to a member
> field within the `p2p_pgmap` struct, not the base pointer of the allocation.
>
> This patch corrects the bug by passing the correct base pointer,
> `p2p_pgmap`, to the devm_kfree() function.
>
> Signed-off-by: Sungho Kim <sungho.kim@...iosa.ai>
Good catch, thank you.
Reviewed-by: Logan Gunthorpe <logang@...tatee.com>
Powered by blists - more mailing lists