lkml.org 
[lkml]   [2006]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateWed, 28 Jun 2006 15:55:49 -0700
From"Russ Cox" <>
SubjectRe: [V9fs-developer] [Patch] Dead code in fs/9p/vfs_inode.c
> coverity (id #971) found some dead code. In all error
> cases ret is NULL, so we can remove the if statement.
>
> Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
>
> --- linux-2.6.17-git11/fs/9p/vfs_inode.c.orig 2006-06-29 00:50:53.000000000 +0200
> +++ linux-2.6.17-git11/fs/9p/vfs_inode.c 2006-06-29 00:51:11.000000000 +0200
> @@ -386,9 +386,6 @@ v9fs_inode_from_fid(struct v9fs_session_
>
> error:
> kfree(fcall);
> - if (ret)
> - iput(ret);
> -
> return ERR_PTR(err);
> }

What about when someone changes the code and does have ret != NULL here?
This seems like reasonable defensive programming to me.

Is the official LK policy that we can't have code that trips coverity
checks like this?

Russ
-
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/

\
 
 \ /
  Last update: 2006-06-29 00:58    [from the cache]
©2003-2010