From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Richard Weinberger <richard@nod.at>
Cc: Artem Bityutskiy <dedekind1@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] UBI: fix return error code
Date: Wed, 9 Dec 2015 17:32:17 +0530 [thread overview]
Message-ID: <20151209120217.GE24852@sudip-pc> (raw)
In-Reply-To: <564EF353.2050806@nod.at>
On Fri, Nov 20, 2015 at 11:17:55AM +0100, Richard Weinberger wrote:
> Am 20.11.2015 um 11:14 schrieb Sudip Mukherjee:
> > We are checking dfs_rootdir for error value or NULL. But in the
> > conditional ternary operator we returned -ENODEV if dfs_rootdir contains
> > an error value and returned PTR_ERR(dfs_rootdir) if dfs_rootdir is NULL.
> > So in the case of dfs_rootdir being NULL we actually assigned 0 to err
> > and returned it to the caller implying a success.
> > Lets return -ENODEV when dfs_rootdir is NULL else return
> > PTR_ERR(dfs_rootdir).
> >
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > ---
> > drivers/mtd/ubi/debug.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
> > index b077e43..c4cb15a 100644
> > --- a/drivers/mtd/ubi/debug.c
> > +++ b/drivers/mtd/ubi/debug.c
> > @@ -236,7 +236,7 @@ int ubi_debugfs_init(void)
> >
> > dfs_rootdir = debugfs_create_dir("ubi", NULL);
> > if (IS_ERR_OR_NULL(dfs_rootdir)) {
> > - int err = dfs_rootdir ? -ENODEV : PTR_ERR(dfs_rootdir);
> > + int err = dfs_rootdir ? PTR_ERR(dfs_rootdir) : -ENODEV;
> >
>
> Nice catch!
Hi Richard,
It is still not on linus-next. Did you miss it?
regards
sudip
next prev parent reply other threads:[~2015-12-09 12:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 10:14 [PATCH] UBI: fix return error code Sudip Mukherjee
2015-11-20 10:17 ` Richard Weinberger
2015-12-09 12:02 ` Sudip Mukherjee [this message]
2015-12-09 12:07 ` Richard Weinberger
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=20151209120217.GE24852@sudip-pc \
--to=sudipm.mukherjee@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
/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).