Linux-CIFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] cifs: Fix missed free operations
@ 2019-10-14  7:15 Chuhong Yuan
  2019-10-14 21:43 ` Pavel Shilovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Chuhong Yuan @ 2019-10-14  7:15 UTC (permalink / raw)
  To: unlisted-recipients:; (no To-header on input)
  Cc: Steve French, linux-cifs, samba-technical, linux-kernel, Chuhong Yuan

cifs_setattr_nounix has two paths which miss free operations
for xid and fullpath.
Use goto cifs_setattr_exit like other paths to fix them.

Fixes: aa081859b10c ("cifs: flush before set-info if we have writeable handles")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 fs/cifs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 5dcc95b38310..df9377828e2f 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -2475,9 +2475,9 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
 			rc = tcon->ses->server->ops->flush(xid, tcon, &wfile->fid);
 			cifsFileInfo_put(wfile);
 			if (rc)
-				return rc;
+				goto cifs_setattr_exit;
 		} else if (rc != -EBADF)
-			return rc;
+			goto cifs_setattr_exit;
 		else
 			rc = 0;
 	}
-- 
2.20.1


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

* Re: [PATCH] cifs: Fix missed free operations
  2019-10-14  7:15 [PATCH] cifs: Fix missed free operations Chuhong Yuan
@ 2019-10-14 21:43 ` Pavel Shilovsky
  2019-10-15  4:53   ` Steve French
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Shilovsky @ 2019-10-14 21:43 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Steve French, linux-cifs, samba-technical, Kernel Mailing List

пн, 14 окт. 2019 г. в 00:18, Chuhong Yuan <hslester96@gmail.com>:
>
> cifs_setattr_nounix has two paths which miss free operations
> for xid and fullpath.
> Use goto cifs_setattr_exit like other paths to fix them.
>
> Fixes: aa081859b10c ("cifs: flush before set-info if we have writeable handles")
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>  fs/cifs/inode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 5dcc95b38310..df9377828e2f 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -2475,9 +2475,9 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
>                         rc = tcon->ses->server->ops->flush(xid, tcon, &wfile->fid);
>                         cifsFileInfo_put(wfile);
>                         if (rc)
> -                               return rc;
> +                               goto cifs_setattr_exit;
>                 } else if (rc != -EBADF)
> -                       return rc;
> +                       goto cifs_setattr_exit;
>                 else
>                         rc = 0;
>         }
> --
> 2.20.1
>

Looks good, thanks.

Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>

The original patch was tagged for stable, so, it seems that this one
should be tagged too.

--
Best regards,
Pavel Shilovsky

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

* Re: [PATCH] cifs: Fix missed free operations
  2019-10-14 21:43 ` Pavel Shilovsky
@ 2019-10-15  4:53   ` Steve French
  0 siblings, 0 replies; 3+ messages in thread
From: Steve French @ 2019-10-15  4:53 UTC (permalink / raw)
  To: Pavel Shilovsky
  Cc: Chuhong Yuan, Steve French, linux-cifs, samba-technical,
	Kernel Mailing List

Merged into cifs-2.6.git for-next and cc: stable for 5.3

On Mon, Oct 14, 2019 at 4:43 PM Pavel Shilovsky via samba-technical
<samba-technical@lists.samba.org> wrote:
>
> пн, 14 окт. 2019 г. в 00:18, Chuhong Yuan <hslester96@gmail.com>:
> >
> > cifs_setattr_nounix has two paths which miss free operations
> > for xid and fullpath.
> > Use goto cifs_setattr_exit like other paths to fix them.
> >
> > Fixes: aa081859b10c ("cifs: flush before set-info if we have writeable handles")
> > Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> > ---
> >  fs/cifs/inode.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> > index 5dcc95b38310..df9377828e2f 100644
> > --- a/fs/cifs/inode.c
> > +++ b/fs/cifs/inode.c
> > @@ -2475,9 +2475,9 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
> >                         rc = tcon->ses->server->ops->flush(xid, tcon, &wfile->fid);
> >                         cifsFileInfo_put(wfile);
> >                         if (rc)
> > -                               return rc;
> > +                               goto cifs_setattr_exit;
> >                 } else if (rc != -EBADF)
> > -                       return rc;
> > +                       goto cifs_setattr_exit;
> >                 else
> >                         rc = 0;
> >         }
> > --
> > 2.20.1
> >
>
> Looks good, thanks.
>
> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
>
> The original patch was tagged for stable, so, it seems that this one
> should be tagged too.
>
> --
> Best regards,
> Pavel Shilovsky
>


-- 
Thanks,

Steve

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14  7:15 [PATCH] cifs: Fix missed free operations Chuhong Yuan
2019-10-14 21:43 ` Pavel Shilovsky
2019-10-15  4:53   ` Steve French

Linux-CIFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-cifs/0 linux-cifs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-cifs linux-cifs/ https://lore.kernel.org/linux-cifs \
		linux-cifs@vger.kernel.org
	public-inbox-index linux-cifs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-cifs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git