* [PATCH] cifs: Fix memory leak in cifs_hardlink()
@ 2014-01-11 0:57 Christian Engelmayer
2014-01-13 15:48 ` Steve French
0 siblings, 1 reply; 2+ messages in thread
From: Christian Engelmayer @ 2014-01-11 0:57 UTC (permalink / raw)
To: Steve French; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA
Fix a potential memory leak in the cifs_hardlink() error handling path.
Detected by Coverity: CID 728510, CID 728511.
Signed-off-by: Christian Engelmayer <cengelma-RbZlAiThDcE@public.gmane.org>
---
fs/cifs/link.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 92aee08..28bc8ee 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -438,8 +438,10 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
CIFS_MOUNT_MAP_SPECIAL_CHR);
else {
server = tcon->ses->server;
- if (!server->ops->create_hardlink)
- return -ENOSYS;
+ if (!server->ops->create_hardlink) {
+ rc = -ENOSYS;
+ goto cifs_hl_exit;
+ }
rc = server->ops->create_hardlink(xid, tcon, from_name, to_name,
cifs_sb);
if ((rc == -EIO) || (rc == -EINVAL))
--
1.8.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cifs: Fix memory leak in cifs_hardlink()
2014-01-11 0:57 [PATCH] cifs: Fix memory leak in cifs_hardlink() Christian Engelmayer
@ 2014-01-13 15:48 ` Steve French
0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2014-01-13 15:48 UTC (permalink / raw)
To: Christian Engelmayer; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA
Merged into cifs-2.6.git
On Fri, Jan 10, 2014 at 6:57 PM, Christian Engelmayer <cengelma-RbZlAiThDcE@public.gmane.org> wrote:
> Fix a potential memory leak in the cifs_hardlink() error handling path.
> Detected by Coverity: CID 728510, CID 728511.
>
> Signed-off-by: Christian Engelmayer <cengelma-RbZlAiThDcE@public.gmane.org>
> ---
> fs/cifs/link.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/link.c b/fs/cifs/link.c
> index 92aee08..28bc8ee 100644
> --- a/fs/cifs/link.c
> +++ b/fs/cifs/link.c
> @@ -438,8 +438,10 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
> CIFS_MOUNT_MAP_SPECIAL_CHR);
> else {
> server = tcon->ses->server;
> - if (!server->ops->create_hardlink)
> - return -ENOSYS;
> + if (!server->ops->create_hardlink) {
> + rc = -ENOSYS;
> + goto cifs_hl_exit;
> + }
> rc = server->ops->create_hardlink(xid, tcon, from_name, to_name,
> cifs_sb);
> if ((rc == -EIO) || (rc == -EINVAL))
> --
> 1.8.3.2
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-13 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-11 0:57 [PATCH] cifs: Fix memory leak in cifs_hardlink() Christian Engelmayer
2014-01-13 15:48 ` Steve French
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.