Message ID | 20180420131519.30510-1-colin.king@canonical.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index f0a759dd6817..207883b39362 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -684,8 +684,10 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, goto mknod_out; } - if (!S_ISCHR(mode) && !S_ISBLK(mode)) + if (!S_ISCHR(mode) && !S_ISBLK(mode)) { + kfree(full_path); return -EPERM; + } if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) goto mknod_out;