diff mbox

[V9fs-developer] 9p: Add missing cast for the error return value in v9fs_get_inode

Message ID 1248572735-24099-1-git-send-email-adkulkar@umail.iu.edu (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Abhishek Kulkarni July 26, 2009, 1:45 a.m. UTC
Cast the error return value (ENOMEM) in v9fs_get_inode() to its
correct type using ERR_PTR.
---
:100644 100644 fac30d2... 06a223d... M	fs/9p/vfs_inode.c
 fs/9p/vfs_inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Abhishek Kulkarni July 26, 2009, 1:54 a.m. UTC | #1
Sorry -- this patch is on top of my previous patch ([PATCH] 9p: Fix possible
inode leak in v9fs_get_inode.)
I am not sure how I missed it. It showed up because gcc 4.3.4 bugs about it.

Thanks,
Abhishek

On Sat, Jul 25, 2009 at 7:45 PM, Abhishek Kulkarni <adkulkar@umail.iu.edu>wrote:

> Cast the error return value (ENOMEM) in v9fs_get_inode() to its
> correct type using ERR_PTR.
> ---
> :100644 100644 fac30d2... 06a223d... M  fs/9p/vfs_inode.c
>  fs/9p/vfs_inode.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
> index fac30d2..06a223d 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -215,7 +215,7 @@ struct inode *v9fs_get_inode(struct super_block *sb,
> int mode)
>        inode = new_inode(sb);
>        if (!inode) {
>                P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n");
> -               return -ENOMEM;
> +               return ERR_PTR(-ENOMEM);
>        }
>
>        inode->i_mode = mode;
> --
> 1.6.0.4
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> V9fs-developer mailing list
> V9fs-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/v9fs-developer
>
------------------------------------------------------------------------------
diff mbox

Patch

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index fac30d2..06a223d 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -215,7 +215,7 @@  struct inode *v9fs_get_inode(struct super_block *sb, int mode)
 	inode = new_inode(sb);
 	if (!inode) {
 		P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n");
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 	}
 
 	inode->i_mode = mode;