[Ocfs2-devel] [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set()

2012-04-17 Thread Dan Carpenter
If ret is NULL, then hs is also NULL, so there is no need to free it. config_group_init_type_name() can't fail if the name (heartbeat in this case) is less than CONFIGFS_ITEM_NAME_LEN (20) characters long so we can just remove this error handling code. Signed-off-by: Dan Carpenter

Re: [Ocfs2-devel] [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set()

2012-04-17 Thread Dan Carpenter
On Mon, Feb 13, 2012 at 12:04:09PM -0800, Joel Becker wrote: On Mon, Feb 13, 2012 at 04:50:47PM +0300, Dan Carpenter wrote: If ret is NULL, then hs is also NULL, so there is no need to free it. config_group_init_type_name() can't fail if the name (heartbeat in this case) is less than

Re: [Ocfs2-devel] [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set()

2012-04-17 Thread Dan Carpenter
On Mon, Feb 13, 2012 at 11:39:27AM -0800, Sunil Mushran wrote: hmm... I would say NAK because config_group_item_type_name() could change in the future. And there is nothing wrong with the current code. The error handling isn't correct because checking hs-hs_group for NULL doesn't work. hs and

Re: [Ocfs2-devel] [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set()

2012-02-13 Thread Sunil Mushran
hmm... I would say NAK because config_group_item_type_name() could change in the future. And there is nothing wrong with the current code. On 02/13/2012 05:50 AM, Dan Carpenter wrote: If ret is NULL, then hs is also NULL, so there is no need to free it. config_group_init_type_name() can't fail

Re: [Ocfs2-devel] [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set()

2012-02-13 Thread Joel Becker
On Mon, Feb 13, 2012 at 04:50:47PM +0300, Dan Carpenter wrote: If ret is NULL, then hs is also NULL, so there is no need to free it. config_group_init_type_name() can't fail if the name (heartbeat in this case) is less than CONFIGFS_ITEM_NAME_LEN (20) characters long so we can just remove

Re: [Ocfs2-devel] [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set()

2012-02-13 Thread Sunil Mushran
On 02/13/2012 12:29 PM, Dan Carpenter wrote: On Mon, Feb 13, 2012 at 12:04:09PM -0800, Joel Becker wrote: On Mon, Feb 13, 2012 at 04:50:47PM +0300, Dan Carpenter wrote: If ret is NULL, then hs is also NULL, so there is no need to free it. config_group_init_type_name() can't fail if the name