From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: shaw@vranix.com
Cc: lkml <linux-kernel@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Ulrich Drepper <drepper@redhat.com>,
Andrew Morton <akpm@osdl.org>, netdev <netdev@vger.kernel.org>,
Zach Brown <zach.brown@oracle.com>,
Christoph Hellwig <hch@infradead.org>,
Chase Venters <chase.venters@clientec.com>,
Johann Borck <johann.borck@densedata.com>
Subject: Re: [take17 1/4] kevent: Core files.
Date: Fri, 8 Sep 2006 10:38:09 +0400 [thread overview]
Message-ID: <20060908063808.GA28736@2ka.mipt.ru> (raw)
In-Reply-To: <200609072105.16061.shaw@vranix.com>
On Thu, Sep 07, 2006 at 09:05:16PM -0700, shaw@vranix.com (shaw@vranix.com) wrote:
> > +static int __devinit kevent_user_init(void)
> > +{
> > + int err = 0;
> > +
> > + kevent_cache = kmem_cache_create("kevent_cache",
> > + sizeof(struct kevent), 0, SLAB_PANIC, NULL, NULL);
> > +
> > + err = misc_register(&kevent_miscdev);
> > + if (err) {
> > + printk(KERN_ERR "Failed to register kevent miscdev: err=%d.\n", err);
> > + goto err_out_exit;
> > + }
> > +
> > + printk("KEVENT subsystem has been successfully registered.\n");
> > +
> > + return 0;
> > +
> > +err_out_exit:
> > + kmem_cache_destroy(kevent_cache);
> > + return err;
> > +}
>
> It's probably best to treat kmem_cache_create like a black box and check for
> it returning null.
It can not return NULL, it will panic instead since I use SLAB_PANIC
flag.
> Thanks,
> Shaw
--
Evgeniy Polyakov
next prev parent reply other threads:[~2006-09-08 6:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1qwel34p2jrwe5.GA1898@2ka.mipt.ru>
2006-09-07 9:57 ` [take17 0/4] kevent: Generic event handling mechanism Evgeniy Polyakov
2006-09-07 9:59 ` [take17 1/4] kevent: Core files Evgeniy Polyakov
2006-09-07 9:59 ` [take17 2/4] kevent: poll/select() notifications Evgeniy Polyakov
2006-09-07 9:59 ` [take17 3/4] kevent: Socket notifications Evgeniy Polyakov
2006-09-07 9:59 ` [take17 4/4] kevent: Timer notifications Evgeniy Polyakov
2006-09-08 4:05 ` [take17 1/4] kevent: Core files shaw
2006-09-08 6:38 ` Evgeniy Polyakov [this message]
2006-09-08 17:06 ` shawvrana
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=20060908063808.GA28736@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=akpm@osdl.org \
--cc=chase.venters@clientec.com \
--cc=davem@davemloft.net \
--cc=drepper@redhat.com \
--cc=hch@infradead.org \
--cc=johann.borck@densedata.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shaw@vranix.com \
--cc=zach.brown@oracle.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;
as well as URLs for NNTP newsgroup(s).