mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] plug leaks in aic7xxx_osm
Date: Wed, 1 Sep 2004 16:51:21 +0100	[thread overview]
Message-ID: <200409011551.i81FpLcH000635@delerium.codemonkey.org.uk> (raw)

Spotted with the source checker from Coverity.com.

Signed-off-by: Dave Jones <davej@redhat.com>


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/scsi/aic7xxx/aic7xxx_osm.c linux-2.6/drivers/scsi/aic7xxx/aic7xxx_osm.c
--- bk-linus/drivers/scsi/aic7xxx/aic7xxx_osm.c	2004-08-28 21:57:23.000000000 +0100
+++ linux-2.6/drivers/scsi/aic7xxx/aic7xxx_osm.c	2004-09-01 13:31:12.000000000 +0100
@@ -1408,6 +1408,7 @@ ahc_dmamem_alloc(struct ahc_softc *ahc, 
 	if (ahc->dev_softc != NULL)
 		if (ahc_pci_set_dma_mask(ahc->dev_softc, 0xFFFFFFFF)) {
 			printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
+			kfree(map);
 			return (ENODEV);
 		}
 	*vaddr = pci_alloc_consistent(ahc->dev_softc,
@@ -1416,6 +1417,7 @@ ahc_dmamem_alloc(struct ahc_softc *ahc, 
 		if (ahc_pci_set_dma_mask(ahc->dev_softc,
 				     ahc->platform_data->hw_dma_mask)) {
 			printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
+			kfree(map);
 			return (ENODEV);
 		}
 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */

                 reply	other threads:[~2004-09-01 16:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200409011551.i81FpLcH000635@delerium.codemonkey.org.uk \
    --to=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®