From bc7878a2c7dca3efa8f264eadd2693edc91e6ec3 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Sun, 15 May 2022 09:43:15 -0400 Subject: [PATCH] silence double free warning clang static analysis reports this issue on RHEL open-gpu-kernel-modules/kernel-open/nvidia/nv.c:1392:9: warning: Attempt to free released memory [unix.Malloc] NV_KFREE(nvl->irq_count, nvl->num_intr*sizeof(nv_irq_count_info_t)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is a false positive, NV_FLAG_USES_MSIX and NV_FLAG_USES_MSI are mutually exclusive. Convert the NV_FLAG_USE_MSIX 'if' to an 'if else' Signed-off-by: Tom Rix --- kernel-open/nvidia/nv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel-open/nvidia/nv.c b/kernel-open/nvidia/nv.c index dbcd8c04f..8db8b790e 100644 --- a/kernel-open/nvidia/nv.c +++ b/kernel-open/nvidia/nv.c @@ -1385,7 +1385,7 @@ failed: if(nvl->irq_count) NV_KFREE(nvl->irq_count, nvl->num_intr * sizeof(nv_irq_count_info_t)); } - if (nv->flags & NV_FLAG_USES_MSIX) + else if (nv->flags & NV_FLAG_USES_MSIX) { nv->flags &= ~NV_FLAG_USES_MSIX; pci_disable_msix(nvl->pci_dev);