All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jay Estabrook <jay.estabrook@hp.com>
To: rth@twiddle.net
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jay Estabrook <jay.estabrook@hp.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/7] ALPHA: support graphics on non-zero PCI domains
Date: Wed, 11 Apr 2007 13:32:19 -0400	[thread overview]
Message-ID: <461D1BA3.60903@hp.com> (raw)
In-Reply-To: <20070411160520.GB12573@twiddle.net>

Richard Henderson wrote:
> On Wed, Apr 11, 2007 at 12:30:48PM +0400, Ivan Kokshaysky wrote:
>   
>> +VGA_MAP_MEM(unsigned long xaddr, unsigned int size)
>> +{
>> +	/* Create a new VGA ioport resource WRT the hose it is on. */
>> +	if (pci_vga_hose && pci_vga_hose->index) {
>> +		static struct resource alpha_vga =
>> +		  { .name = "alpha-vga+", .start = 0x3C0, .end = 0x3DF };
>> +		struct resource new_vga = alpha_vga;
>> +
>> +		new_vga.start += pci_vga_hose->io_space->start;
>> +		new_vga.end   += pci_vga_hose->io_space->start;
>> +		request_resource(&ioport_resource, &new_vga);
>>     
>
> This leaks the local stack frame variable new_vga into the
> resource tree, does it not?  Shouldn't you be kmallocing this?
>
>
> r~
>   
Yes, it does leak, and yes, it should be kmalloced. Something like this?

        struct resource *new_vga;

        new_vga = kmalloc(sizeof(struct resource), GFP_ATOMIC);
        if (new_vga) {
            *new_vga = alpha_vga;
            new_vga->start += pci_vga_hose->io_space->start;
            new_vga->end   += pci_vga_hose->io_space->start;
            request_resource(&ioport_resource, new_vga);
        }

Thanks, Richard, I'll regenerate this one...

--Jay++

-- 
Jay A Estabrook                            HPTC - XC I & B
Hewlett-Packard Company - ZKO1-3/D-B.8     (603) 884-0301
110 Spit Brook Road, Nashua NH 03062       Jay.Estabrook@hp.com


  reply	other threads:[~2007-04-11 17:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-11  8:30 [PATCH 7/7] ALPHA: support graphics on non-zero PCI domains Ivan Kokshaysky
2007-04-11 16:05 ` Richard Henderson
2007-04-11 17:32   ` Jay Estabrook [this message]
2007-04-11 20:21     ` Ivan Kokshaysky

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=461D1BA3.60903@hp.com \
    --to=jay.estabrook@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=ink@jurassic.park.msu.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.