lkml.org 
[lkml]   [2006]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [take17 1/4] kevent: Core files.
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-08 08:41    [W:0.037 / U:7.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site