All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ovl: Return -ENOMEM if an allocation fails ovl_lookup()
@ 2017-09-22 20:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-09-22 20:45 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-unionfs, kernel-janitors

The error code is missing here so it means we return ERR_PTR(0) or NULL.
The other error paths all return an error code so this probably should
as well.

Fixes: 02b69b284cd7 ("ovl: lookup redirects")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index c3addd1114f1..beb8a988df51 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -634,6 +634,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
 		}
 
 		if (d.redirect) {
+			err = -ENOMEM;
 			upperredirect = kstrdup(d.redirect, GFP_KERNEL);
 			if (!upperredirect)
 				goto out_put_upper;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ovl: Return -ENOMEM if an allocation fails ovl_lookup()
@ 2017-09-22 20:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-09-22 20:45 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-unionfs, kernel-janitors

The error code is missing here so it means we return ERR_PTR(0) or NULL.
The other error paths all return an error code so this probably should
as well.

Fixes: 02b69b284cd7 ("ovl: lookup redirects")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index c3addd1114f1..beb8a988df51 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -634,6 +634,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
 		}
 
 		if (d.redirect) {
+			err = -ENOMEM;
 			upperredirect = kstrdup(d.redirect, GFP_KERNEL);
 			if (!upperredirect)
 				goto out_put_upper;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ovl: Return -ENOMEM if an allocation fails ovl_lookup()
  2017-09-22 20:45 ` Dan Carpenter
@ 2017-09-23  3:53   ` Chandan Rajendra
  -1 siblings, 0 replies; 4+ messages in thread
From: Chandan Rajendra @ 2017-09-23  3:41 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Miklos Szeredi, linux-unionfs, kernel-janitors

On Saturday, September 23, 2017 2:15:18 AM IST Dan Carpenter wrote:
> The error code is missing here so it means we return ERR_PTR(0) or NULL.
> The other error paths all return an error code so this probably should
> as well.
> 
> Fixes: 02b69b284cd7 ("ovl: lookup redirects")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
> index c3addd1114f1..beb8a988df51 100644
> --- a/fs/overlayfs/namei.c
> +++ b/fs/overlayfs/namei.c
> @@ -634,6 +634,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
>  		}
> 
>  		if (d.redirect) {
> +			err = -ENOMEM;
>  			upperredirect = kstrdup(d.redirect, GFP_KERNEL);
>  			if (!upperredirect)
>  				goto out_put_upper;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

The patch looks good.

Reviewed-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>

-- 
chandan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ovl: Return -ENOMEM if an allocation fails ovl_lookup()
@ 2017-09-23  3:53   ` Chandan Rajendra
  0 siblings, 0 replies; 4+ messages in thread
From: Chandan Rajendra @ 2017-09-23  3:53 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Miklos Szeredi, linux-unionfs, kernel-janitors

On Saturday, September 23, 2017 2:15:18 AM IST Dan Carpenter wrote:
> The error code is missing here so it means we return ERR_PTR(0) or NULL.
> The other error paths all return an error code so this probably should
> as well.
> 
> Fixes: 02b69b284cd7 ("ovl: lookup redirects")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
> index c3addd1114f1..beb8a988df51 100644
> --- a/fs/overlayfs/namei.c
> +++ b/fs/overlayfs/namei.c
> @@ -634,6 +634,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
>  		}
> 
>  		if (d.redirect) {
> +			err = -ENOMEM;
>  			upperredirect = kstrdup(d.redirect, GFP_KERNEL);
>  			if (!upperredirect)
>  				goto out_put_upper;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

The patch looks good.

Reviewed-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>

-- 
chandan


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-23  3:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22 20:45 [PATCH] ovl: Return -ENOMEM if an allocation fails ovl_lookup() Dan Carpenter
2017-09-22 20:45 ` Dan Carpenter
2017-09-23  3:41 ` Chandan Rajendra
2017-09-23  3:53   ` Chandan Rajendra

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.