linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -3rd repost 1/3] SCSI: aacraid, fix memory leak
@ 2009-12-10 13:37 Jiri Slaby
  2009-12-10 13:37 ` [PATCH -3rd repost 2/3] SCSI: remove unnecessary NULL test Jiri Slaby
  2009-12-10 13:37 ` [PATCH -3rd repost 3/3] SCSI: lpfc, fix memory leak Jiri Slaby
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Slaby @ 2009-12-10 13:37 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, linux-kernel, Jiri Slaby

From: Jiri Slaby <jirislaby@gmail.com>

Stanse found a memory leak on one fail path in aac_send_raw_srb. Add kfree
there.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: James E.J. Bottomley <James.Bottomley@suse.de>
---
 drivers/scsi/aacraid/commctrl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 0391d75..5c9a8be 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -649,6 +649,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
 				     AAC_OPT_NEW_COMM) ?
 				      (dev->scsi_host_ptr->max_sectors << 9) :
 				      65536) {
+					kfree (usg);
 					rcode = -EINVAL;
 					goto cleanup;
 				}
-- 
1.6.5.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH -3rd repost 2/3] SCSI: remove unnecessary NULL test
  2009-12-10 13:37 [PATCH -3rd repost 1/3] SCSI: aacraid, fix memory leak Jiri Slaby
@ 2009-12-10 13:37 ` Jiri Slaby
  2009-12-10 13:37 ` [PATCH -3rd repost 3/3] SCSI: lpfc, fix memory leak Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2009-12-10 13:37 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, linux-kernel, Jiri Slaby

From: Jiri Slaby <jirislaby@gmail.com>

Stanse found that c3cn is poked many times around in
cxgb3i_conn_pdu_ready, there is no need to check if it is NULL.

Remove the test.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: James E.J. Bottomley <James.Bottomley@suse.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/cxgb3i/cxgb3i_pdu.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/cxgb3i/cxgb3i_pdu.c b/drivers/scsi/cxgb3i/cxgb3i_pdu.c
index 7091050..64bbc28 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_pdu.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_pdu.c
@@ -461,10 +461,8 @@ void cxgb3i_conn_pdu_ready(struct s3_conn *c3cn)
 		skb = skb_peek(&c3cn->receive_queue);
 	}
 	read_unlock(&c3cn->callback_lock);
-	if (c3cn) {
-		c3cn->copied_seq += read;
-		cxgb3i_c3cn_rx_credits(c3cn, read);
-	}
+	c3cn->copied_seq += read;
+	cxgb3i_c3cn_rx_credits(c3cn, read);
 	conn->rxdata_octets += read;
 
 	if (err) {
-- 
1.6.5.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH -3rd repost 3/3] SCSI: lpfc, fix memory leak
  2009-12-10 13:37 [PATCH -3rd repost 1/3] SCSI: aacraid, fix memory leak Jiri Slaby
  2009-12-10 13:37 ` [PATCH -3rd repost 2/3] SCSI: remove unnecessary NULL test Jiri Slaby
@ 2009-12-10 13:37 ` Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2009-12-10 13:37 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, linux-kernel, Jiri Slaby

From: Jiri Slaby <jirislaby@gmail.com>

Stanse found a memory leak on one fail path in lpfc_sli4_read_rev.

Add there kfree.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: James Smart <james.smart@emulex.com>
Cc: James E.J. Bottomley <James.Bottomley@suse.de>
---
 drivers/scsi/lpfc/lpfc_sli.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 7935667..487cf8e 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -4110,6 +4110,7 @@ lpfc_sli4_read_rev(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq,
 	if (rc) {
 		dma_free_coherent(&phba->pcidev->dev, dma_size,
 				  dmabuf->virt, dmabuf->phys);
+		kfree(dmabuf);
 		return -EIO;
 	}
 
-- 
1.6.5.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-10 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-10 13:37 [PATCH -3rd repost 1/3] SCSI: aacraid, fix memory leak Jiri Slaby
2009-12-10 13:37 ` [PATCH -3rd repost 2/3] SCSI: remove unnecessary NULL test Jiri Slaby
2009-12-10 13:37 ` [PATCH -3rd repost 3/3] SCSI: lpfc, fix memory leak Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).