git: dda1c30ffe54 - stable/14 - mana: fix leaking pci resource problem detaching mana deivces

From: Wei Hu <whu_at_FreeBSD.org>
Date: Thu, 29 Feb 2024 06:54:23 UTC
The branch stable/14 has been updated by whu:

URL: https://cgit.FreeBSD.org/src/commit/?id=dda1c30ffe5433952c8d7597ed05c74d1721a73a

commit dda1c30ffe5433952c8d7597ed05c74d1721a73a
Author:     Wei Hu <whu@FreeBSD.org>
AuthorDate: 2024-02-13 09:21:14 +0000
Commit:     Wei Hu <whu@FreeBSD.org>
CommitDate: 2024-02-29 06:37:23 +0000

    mana: fix leaking pci resource problem detaching mana deivces
    
    Fixing the error messages when detaching the mana gdma devices
    showed in dmesg: "Device leaked memory resources".
    
    Reported by:    NetApp
    MFC after:      3 days
    Sponsored by:   Microsoft
    
    (cherry picked from commit 47e99e5bc5bcfa621fe6a3e62386f227c47e8cff)
---
 sys/dev/mana/gdma_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c
index a601873876cb..e09918496b03 100644
--- a/sys/dev/mana/gdma_main.c
+++ b/sys/dev/mana/gdma_main.c
@@ -1562,7 +1562,7 @@ alloc_bar_out:
 static void
 mana_gd_free_pci_res(struct gdma_context *gc)
 {
-	if (!gc || gc->dev)
+	if (!gc || !gc->dev)
 		return;
 
 	if (gc->bar0 != NULL) {