* [PATCH] [scsi] lpfc: potential leak in lpfc_sli_hbqbuf_fill_hbqs
@ 2007-07-19 15:50 Florin Malita
2007-07-19 17:44 ` James Smart
0 siblings, 1 reply; 3+ messages in thread
From: Florin Malita @ 2007-07-19 15:50 UTC (permalink / raw)
To: James.Smart; +Cc: James.Bottomley, Linux Kernel Mailing List
If lpfc_hbq_alloc() fails, an hbq_buffer is leaked. Found by Coverity
(1775).
Signed-off-by: Florin Malita <fmalita@gmail.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++;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] [scsi] lpfc: potential leak in lpfc_sli_hbqbuf_fill_hbqs
2007-07-19 15:50 [PATCH] [scsi] lpfc: potential leak in lpfc_sli_hbqbuf_fill_hbqs Florin Malita
@ 2007-07-19 17:44 ` James Smart
2007-07-19 17:58 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: James Smart @ 2007-07-19 17:44 UTC (permalink / raw)
To: Florin Malita; +Cc: James.Bottomley, Linux Kernel Mailing List, James Smart
Florin,
Thanks for the effort to create this patch. Turns out we have already
fixed this, and have it included in our 8.2.2 patch set, which we will be
posting within the next week.
So James, don't pick this patch up, take the larger patch set instead.
Thanks.
-- james s
Florin Malita wrote:
> If lpfc_hbq_alloc() fails, an hbq_buffer is leaked. Found by Coverity
> (1775).
>
> Signed-off-by: Florin Malita <fmalita@gmail.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++;
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [scsi] lpfc: potential leak in lpfc_sli_hbqbuf_fill_hbqs
2007-07-19 17:44 ` James Smart
@ 2007-07-19 17:58 ` James Bottomley
0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2007-07-19 17:58 UTC (permalink / raw)
To: James.Smart; +Cc: Florin Malita, Linux Kernel Mailing List
On Thu, 2007-07-19 at 13:44 -0400, James Smart wrote:
> Florin,
>
> Thanks for the effort to create this patch. Turns out we have already
> fixed this, and have it included in our 8.2.2 patch set, which we will be
> posting within the next week.
The 2.6.23 merge window is estimated to close on Sunday (22 July) ...
> So James, don't pick this patch up, take the larger patch set instead.
OK, will wait.
James
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-19 17:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-19 15:50 [PATCH] [scsi] lpfc: potential leak in lpfc_sli_hbqbuf_fill_hbqs Florin Malita
2007-07-19 17:44 ` James Smart
2007-07-19 17:58 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox