mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anthony Towns <aj@azure.humbug.org.au>
To: unlisted-recipients:; (no To-header on input)@pop.zip.com.au
Cc: "'Pasi Kärkkäinen'" <pk@edu.joroinen.fi>,
	Rik van Riel <riel@conectiva.com.br>,
	"Forever shall I be." <zinx@microsoftisevil.com>,
	linux-kernel@vger.kernel.org
Subject: Re: 3-order allocation failed
Date: Thu, 2 Nov 2000 08:20:43 +1000	[thread overview]
Message-ID: <20001102082043.C22439@azure.humbug.org.au> (raw)
In-Reply-To: <D5E932F578EBD111AC3F00A0C96B1E6F07DBDBF3@orsmsx31.jf.intel.com>
In-Reply-To: <D5E932F578EBD111AC3F00A0C96B1E6F07DBDBF3@orsmsx31.jf.intel.com>; from randy.dunlap@intel.com on Wed, Nov 01, 2000 at 01:42:17PM -0800

On Wed, Nov 01, 2000 at 01:42:17PM -0800, Dunlap, Randy wrote:
> > Is this bug in the usb-driver (usb-uhci), in the camera's driver
> > (cpia_usb) or in the v4l?
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Could there be a memory leak as well?  But I expect that
> it's simply that memory is just fragmented so that enough
> contiguous pages aren't available, like Rik said.

There is a memory leak, the memory kmalloc'ed in cpia_usb_open for
sbuf[*].data is never kfree'd (except when an error occurs during
initialisation). Adding some kfree's in cpia_usb_free_resources fixed
the problem in test7 or so, here's a patch against -test10.

--- drivers/media/video/cpia_usb.c.orig	Wed Nov  1 14:14:37 2000
+++ drivers/media/video/cpia_usb.c	Wed Nov  1 14:16:05 2000
@@ -432,10 +432,20 @@
 		ucpia->sbuf[1].urb = NULL;
 	}
 
+	if (ucpia->sbuf[1].data) {
+		kfree(ucpia->sbuf[1].data);
+		ucpia->sbuf[1].data = NULL;
+	}
+ 
 	if (ucpia->sbuf[0].urb) {
 		usb_unlink_urb(ucpia->sbuf[0].urb);
 		usb_free_urb(ucpia->sbuf[0].urb);
 		ucpia->sbuf[0].urb = NULL;
+	}
+
+	if (ucpia->sbuf[0].data) {
+		kfree(ucpia->sbuf[0].data);
+		ucpia->sbuf[0].data = NULL;
 	}
 }

HTH.

Cheers,
aj 

-- 
Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. GPG signed mail preferred.

  ``We reject: kings, presidents, and voting.
                 We believe in: rough consensus and working code.''
                                      -- Dave Clark
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-11-01 22:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-01 21:42 Dunlap, Randy
2000-11-01 22:20 ` Anthony Towns [this message]
2000-11-02 13:49   ` Rik van Riel
2000-11-02 14:14     ` Tigran Aivazian
  -- strict thread matches above, loose matches on Subject: below --
2001-07-23 20:07 Dagfinn Ilmari Mannsåker
2000-11-01 22:39 Dunlap, Randy
     [not found] <20001026091847.A30837@bliss.zebra.net>
2000-10-26 17:11 ` Rik van Riel
2000-10-26 17:24   ` Pasi Kärkkäinen
2000-11-01 11:13   ` Pasi Kärkkäinen
2000-11-02  7:20     ` Andrew Morton

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=20001102082043.C22439@azure.humbug.org.au \
    --to=aj@azure.humbug.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pk@edu.joroinen.fi \
    --cc=riel@conectiva.com.br \
    --cc=zinx@microsoftisevil.com \
    /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®