[PATCH] smb: client: Fix a NULL vs IS_ERR() check in wsl_set_xattrs()

Dan Carpenter posted 1 patch 1 year, 10 months ago
fs/smb/client/reparse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] smb: client: Fix a NULL vs IS_ERR() check in wsl_set_xattrs()
Posted by Dan Carpenter 1 year, 10 months ago
This was intended to be an IS_ERR() check.  The ea_create_context()
function doesn't return NULL.

Fixes: 1eab17fe485c ("smb: client: add support for WSL reparse points")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 fs/smb/client/reparse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c
index ce69d67feefa..d4d2555ebd38 100644
--- a/fs/smb/client/reparse.c
+++ b/fs/smb/client/reparse.c
@@ -225,7 +225,7 @@ static int wsl_set_xattrs(struct inode *inode, umode_t mode,
 	}
 
 	cc = ea_create_context(dlen, &cc_len);
-	if (!cc)
+	if (IS_ERR(cc))
 		return PTR_ERR(cc);
 
 	ea = &cc->ea;
-- 
2.43.0
Re: [PATCH] smb: client: Fix a NULL vs IS_ERR() check in wsl_set_xattrs()
Posted by Steve French 1 year, 10 months ago
Good catch.  Thx.

Added Paulo's RB and added to cifs-2.6.git for-next


On Wed, Jan 31, 2024 at 1:17 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> This was intended to be an IS_ERR() check.  The ea_create_context()
> function doesn't return NULL.
>
> Fixes: 1eab17fe485c ("smb: client: add support for WSL reparse points")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  fs/smb/client/reparse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c
> index ce69d67feefa..d4d2555ebd38 100644
> --- a/fs/smb/client/reparse.c
> +++ b/fs/smb/client/reparse.c
> @@ -225,7 +225,7 @@ static int wsl_set_xattrs(struct inode *inode, umode_t mode,
>         }
>
>         cc = ea_create_context(dlen, &cc_len);
> -       if (!cc)
> +       if (IS_ERR(cc))
>                 return PTR_ERR(cc);
>
>         ea = &cc->ea;
> --
> 2.43.0
>
>


-- 
Thanks,

Steve
Re: [PATCH] smb: client: Fix a NULL vs IS_ERR() check in wsl_set_xattrs()
Posted by Paulo Alcantara 1 year, 10 months ago
Dan Carpenter <dan.carpenter@linaro.org> writes:

> This was intended to be an IS_ERR() check.  The ea_create_context()
> function doesn't return NULL.
>
> Fixes: 1eab17fe485c ("smb: client: add support for WSL reparse points")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  fs/smb/client/reparse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Paulo Alcantara <pc@manguebit.com>