Linux ocfs2 filesystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set()
Date: Mon, 13 Feb 2012 20:06:43 -0000	[thread overview]
Message-ID: <20120213200835.GK4141@mwanda> (raw)
In-Reply-To: <4F3966EF.9070405@oracle.com>

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 "&hs->hs_group" are the same
address and we checked "hs" already.  If we wanted to check for
allocation errors, then we would need to change the check to:

        if (!hs->hs_group.cg_item.ci_name)
		kfree(hs);

But that's not how the function is supposed to be used.  The example
code in Documentation/filesystems/configfs/configfs_example_explicit.c
doesn't have error handling.

regards,
dan carpenter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120213/de7d1584/attachment-0001.bin 

  reply	other threads:[~2012-02-13 20:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13 13:50 [Ocfs2-devel] [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set() Dan Carpenter
2012-02-13 19:39 ` Sunil Mushran
2012-02-13 20:06   ` Dan Carpenter [this message]
2012-02-13 20:17     ` Sunil Mushran
2012-04-17 21:13     ` [Ocfs2-devel] Ocfs2 + Quota! Marek Królikowski
2012-02-13 20:04 ` [Ocfs2-devel] [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set() Joel Becker
2012-02-13 20:27   ` Dan Carpenter
2012-02-13 20:41     ` Sunil Mushran

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=20120213200835.GK4141@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ocfs2-devel@oss.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