public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Bug in kmem_cache_create with duplicate names
Date: Tue, 07 Dec 2004 11:21:16 -0500	[thread overview]
Message-ID: <1102436476.25841.265.camel@localhost.localdomain> (raw)
In-Reply-To: <41B5CD41.9050102@osdl.org>

On Tue, 2004-12-07 at 07:33 -0800, Randy.Dunlap wrote:

> Duplicate name can just return NULL.  NOTE:  Such a change most
> likely requires an audit of all callers of kmem_cache_create()
> to be sure that they check its return value.  There's a gcc
> attribute that can be added to the function prototype to
> warn if the function is called without looking at its
> return value, although just doing
> 	x = kmem_cache_create(...);
> and ignoring x probably evades the warning.
> 

I would hope that the kernel does check the return, since it still can
fail for other reasons an return a NULL, and it is more likely to fail
for other reasons, since this will already BUG on the duplicate case.
But your suggestion is probably a good one, and I'm sure there are
probably other calls that should have that same check.

-- Steve

      parent reply	other threads:[~2004-12-07 16:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-07 15:40 Bug in kmem_cache_create with duplicate names Steven Rostedt
2004-12-07 15:33 ` Randy.Dunlap
2004-12-07 16:15   ` Arjan van de Ven
2004-12-07 15:42     ` Randy.Dunlap
     [not found]     ` <1102436777.25841.271.camel@localhost.localdomain>
2004-12-07 16:31       ` Steven Rostedt
2004-12-07 17:57         ` Peter W. Morreale
2004-12-07 18:24           ` Steven Rostedt
2004-12-07 16:21   ` Steven Rostedt [this message]

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=1102436476.25841.265.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rddunlap@osdl.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