[PATCH] cifs: initialize target_path to NULL in cifs_follow_link
Jeff Layton <[email protected]>
| Newsgroups | gmane.linux.file-systems.cifs |
|---|---|
| Message-ID | <[email protected]> |
It's possible for CIFSSMBQueryUnixSymLink to return without setting target_path to a valid pointer. If that happens then the current value to which we're initializing this pointer could cause an oops when it's kfree'd. Signed-off-by: Jeff Layton <[email protected]> --- fs/cifs/link.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/cifs/link.c b/fs/cifs/link.c index ea9d11e..b103164 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -110,7 +110,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) int rc = -EACCES; int xid; char *full_path = NULL; - char *target_path = ERR_PTR(-ENOMEM); + char *target_path = NULL; struct cifs_sb_info *cifs_sb; struct cifsTconInfo *pTcon; -- 1.6.0.6