diff options
| -rw-r--r-- | fs/cifs/dir.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 81ba6e0d88d8..925844343038 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
| @@ -684,6 +684,9 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, | |||
| 684 | goto mknod_out; | 684 | goto mknod_out; |
| 685 | } | 685 | } |
| 686 | 686 | ||
| 687 | if (!S_ISCHR(mode) && !S_ISBLK(mode)) | ||
| 688 | goto mknod_out; | ||
| 689 | |||
| 687 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) | 690 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) |
| 688 | goto mknod_out; | 691 | goto mknod_out; |
| 689 | 692 | ||
| @@ -692,10 +695,8 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, | |||
| 692 | 695 | ||
| 693 | buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); | 696 | buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); |
| 694 | if (buf == NULL) { | 697 | if (buf == NULL) { |
| 695 | kfree(full_path); | ||
| 696 | rc = -ENOMEM; | 698 | rc = -ENOMEM; |
| 697 | free_xid(xid); | 699 | goto mknod_out; |
| 698 | return rc; | ||
| 699 | } | 700 | } |
| 700 | 701 | ||
| 701 | if (backup_cred(cifs_sb)) | 702 | if (backup_cred(cifs_sb)) |
| @@ -742,7 +743,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, | |||
| 742 | pdev->minor = cpu_to_le64(MINOR(device_number)); | 743 | pdev->minor = cpu_to_le64(MINOR(device_number)); |
| 743 | rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms, | 744 | rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms, |
| 744 | &bytes_written, iov, 1); | 745 | &bytes_written, iov, 1); |
| 745 | } /* else if (S_ISFIFO) */ | 746 | } |
| 746 | tcon->ses->server->ops->close(xid, tcon, &fid); | 747 | tcon->ses->server->ops->close(xid, tcon, &fid); |
| 747 | d_drop(direntry); | 748 | d_drop(direntry); |
| 748 | 749 | ||
