[2/2] cifs: fix incorrect error return in build_unc_path_to_root
diff mbox series

Message ID 20190827013558.18281-2-lsahlber@redhat.com
State New
Headers show
Series
  • [1/2] cifs: create a helper to find a writeable handle py path name
Related show

Commit Message

Ronnie Sahlberg Aug. 27, 2019, 1:35 a.m. UTC
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/connect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve French Aug. 27, 2019, 2:14 a.m. UTC | #1
Do you have a simple repro for this one that would lead us to want to cc:stable

On Mon, Aug 26, 2019 at 8:36 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/connect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 1ed449f4a8ec..c5dc8265b671 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -4232,7 +4232,7 @@ build_unc_path_to_root(const struct smb_vol *vol,
>         unsigned int unc_len = strnlen(vol->UNC, MAX_TREE_SIZE + 1);
>
>         if (unc_len > MAX_TREE_SIZE)
> -               return -EINVAL;
> +               return ERR_PTR(-EINVAL);
>
>         full_path = kmalloc(unc_len + pplen + 1, GFP_KERNEL);
>         if (full_path == NULL)
> --
> 2.13.6
>
ronnie sahlberg Aug. 27, 2019, 2:20 a.m. UTC | #2
On Tue, Aug 27, 2019 at 12:15 PM Steve French <smfrench@gmail.com> wrote:
>
> Do you have a simple repro for this one that would lead us to want to cc:stable

I don't have a reproducer.

>
> On Mon, Aug 26, 2019 at 8:36 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
> >
> > Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> > ---
> >  fs/cifs/connect.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> > index 1ed449f4a8ec..c5dc8265b671 100644
> > --- a/fs/cifs/connect.c
> > +++ b/fs/cifs/connect.c
> > @@ -4232,7 +4232,7 @@ build_unc_path_to_root(const struct smb_vol *vol,
> >         unsigned int unc_len = strnlen(vol->UNC, MAX_TREE_SIZE + 1);
> >
> >         if (unc_len > MAX_TREE_SIZE)
> > -               return -EINVAL;
> > +               return ERR_PTR(-EINVAL);
> >
> >         full_path = kmalloc(unc_len + pplen + 1, GFP_KERNEL);
> >         if (full_path == NULL)
> > --
> > 2.13.6
> >
>
>
> --
> Thanks,
>
> Steve
Steve French Aug. 27, 2019, 11 p.m. UTC | #3
I fixed this in an earlier patch of yours

On Mon, Aug 26, 2019 at 8:36 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/connect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 1ed449f4a8ec..c5dc8265b671 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -4232,7 +4232,7 @@ build_unc_path_to_root(const struct smb_vol *vol,
>         unsigned int unc_len = strnlen(vol->UNC, MAX_TREE_SIZE + 1);
>
>         if (unc_len > MAX_TREE_SIZE)
> -               return -EINVAL;
> +               return ERR_PTR(-EINVAL);
>
>         full_path = kmalloc(unc_len + pplen + 1, GFP_KERNEL);
>         if (full_path == NULL)
> --
> 2.13.6
>

Patch
diff mbox series

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 1ed449f4a8ec..c5dc8265b671 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -4232,7 +4232,7 @@  build_unc_path_to_root(const struct smb_vol *vol,
 	unsigned int unc_len = strnlen(vol->UNC, MAX_TREE_SIZE + 1);
 
 	if (unc_len > MAX_TREE_SIZE)
-		return -EINVAL;
+		return ERR_PTR(-EINVAL);
 
 	full_path = kmalloc(unc_len + pplen + 1, GFP_KERNEL);
 	if (full_path == NULL)