lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <469F884B.6010402@gmail.com>
Date:	Thu, 19 Jul 2007 11:50:35 -0400
From:	Florin Malita <fmalita@...il.com>
To:	James.Smart@...lex.com
CC:	James.Bottomley@...elEye.com,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] [scsi] lpfc: potential leak in lpfc_sli_hbqbuf_fill_hbqs

If lpfc_hbq_alloc() fails, an hbq_buffer is leaked. Found by Coverity 
(1775).

Signed-off-by: Florin Malita <fmalita@...il.com>
---

 drivers/scsi/lpfc/lpfc_sli.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index f4d5a6b..fe16b0c 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -622,8 +622,10 @@ lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t hbqno, uint32_t count)
 			return 1;
 		hbq_buffer->dbuf.virt = lpfc_hbq_alloc(phba, MEM_PRI,
 							&hbq_buffer->dbuf.phys);
-		if (hbq_buffer->dbuf.virt == NULL)
+		if (hbq_buffer->dbuf.virt == NULL) {
+			kfree(hbq_buffer);
 			return 1;
+		}
 		hbq_buffer->tag = (i | (hbqno << 16));
 		lpfc_sli_hbq_to_firmware(phba, hbqno, hbq_buffer);
 		lpfc_hbq_defs[hbqno]->buffer_count++;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ