[PATCH 1/1] ubifs: debugfs operations may return both ERRs and NULLs

Artem Bityutskiy dedekind1 at gmail.com
Mon Mar 28 08:10:32 EDT 2011


On Mon, 2011-03-28 at 13:38 +0300, Phil Carmody wrote:
> > I think the right fix would be to fix debugfs and return an error code
> > in any case.
> 
> Agree. Alas it might require hitting a lot of both active and dead code.
> Is that something you want me to look at? If you do it yourself, please
> Cc: me, I'll happily review it.

No, I do not ask you do change debugfs. Do it only if you fare feeling
enthusiastic about this :-) But I do not feel that way, so won't delve
into the debugfs story :-)

All I mean is that we should not do this:

-       if (IS_ERR(ptr)) {
+       if (IS_ERR_OR_NULL(ptr))
-               int err = PTR_ERR(ptr);
-               return err;
+               return -ENODEV;

But rather

-       if (IS_ERR(ptr)) {
+       if (IS_ERR_OR_NULL(ptr)) {
-               int err = PTR_ERR(ptr);
+               int err = ptr ? PTR_ERR(ptr) : -ENODEV;
                return err;

or something like this.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list