Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1287446
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] UBI: fix return error code |
| Date | 2015-12-09 13:10 +0100 |
| Message-ID | <qDLJg-8df-5@gated-at.bofh.it> (permalink) |
| References | <qwQXo-5SQ-21@gated-at.bofh.it> <qwQXo-5SQ-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH] UBI: fix return error code Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-09 13:10 +0100 Re: [PATCH] UBI: fix return error code Richard Weinberger <richard@nod.at> - 2015-12-09 13:10 +0100
csiph-web