mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] fix slub krealloc()
Date: Mon, 23 Jul 2007 14:37:24 -0700	[thread overview]
Message-ID: <20070723143724.1d0b26eb@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070723134713.2b1218bd.akpm@linux-foundation.org>

On Mon, 23 Jul 2007 13:47:13 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:


> > Right. We need to fix util.c. ksize should not be called with a NULL
> > parameter.
> > Index: linux-2.6/mm/util.c
> > ===================================================================
> > --- linux-2.6.orig/mm/util.c	2007-07-23 13:29:42.000000000
> > -0700 +++ linux-2.6/mm/util.c	2007-07-23 13:31:28.000000000
> > -0700 @@ -88,7 +88,11 @@ void *krealloc(const void *p, size_t new
> >  		return ZERO_SIZE_PTR;
> >  	}
> >  
> > -	ks = ksize(p);
> > +	if (p)
> > +		ks = ksize(p);
> > +	else
> > +		ks = 0;
> > +
> >  	if (ks >= new_size)
> >  		return (void *)p;
> >  
> 
> I think we already fixed this?
> 
> commit 1d4ec7b1d6f130818f9b62dea3411d9ee2ff6ff6
> Author: Roland Dreier <rdreier@cisco.com>
> Date:   Fri Jul 20 12:13:20 2007 -0700
> 
>     Fix ZERO_OR_NULL_PTR(ZERO_SIZE_PTR)

There is no use of ZERO_OR_NULL ptr in krealloc. Linus added a check to
ksize() instead so that ksize(NULL) returns 0 instead of failing.



  reply	other threads:[~2007-07-23 21:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18 15:42 Johannes Berg
2007-07-23 20:32 ` Christoph Lameter
2007-07-23 20:47   ` Andrew Morton
2007-07-23 21:37     ` Christoph Lameter [this message]
2007-07-25  8:40       ` Johannes Berg
2007-07-25 18:53         ` Christoph Lameter
2007-07-26 14:08           ` Johannes Berg

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=20070723143724.1d0b26eb@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=johannes@sipsolutions.net \
    --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®