All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
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 13:07:39 +0100	[thread overview]
Message-ID: <5668198B.3050504@nod.at> (raw)
In-Reply-To: <20151209120217.GE24852@sudip-pc>

Am 09.12.2015 um 13:02 schrieb Sudip Mukherjee:
> 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?

I did not miss it, currently I'm traveling a lot and the
days before xmas are always super crazy here.
That's why I'm horrible backlogged.

Thanks,
//richard

      reply	other threads:[~2015-12-09 12:08 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
2015-12-09 12:07     ` Richard Weinberger [this message]

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=5668198B.3050504@nod.at \
    --to=richard@nod.at \
    --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=sudipm.mukherjee@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.