lkml.org 
[lkml]   [2008]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH v2] configfs: Provide variants of config_*_init_type_name() that report errors
On Fri, Jun 20, 2008 at 05:04:11PM +0200, Louis Rilling wrote:
> void config_item_init_type_name(struct config_item *item,
> const char *name,
> struct config_item_type *type)
> {
> - config_item_set_name(item, name);
> - item->ci_type = type;
> - config_item_init(item);
> + int error;
> +
> + error = config_item_init_type_long_name(item, name, type);
> + BUG_ON(error);
> }

This needs to BUG_ON(strlen(name) >= CONIFG_ITEM_NAME_LEN) at
the top. We don't want to allow an invalid construct just because
memory happened to be available :-)
Also, update Documentation/filesystems/configfs/configfs.txt.

Joel

--

"I'm living so far beyond my income that we may almost be said
to be living apart."
- e e cummings

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127


\
 
 \ /
  Last update: 2008-06-21 01:23    [W:0.081 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site