diff options
| -rw-r--r-- | fs/cifs/dir.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index bd363df19b3f..86d3c0c82f25 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
| @@ -261,8 +261,14 @@ int cifs_posix_open(char *full_path, struct inode **pinode, | |||
| 261 | * cifs_fill_filedata() takes care of setting cifsFileInfo pointer to | 261 | * cifs_fill_filedata() takes care of setting cifsFileInfo pointer to |
| 262 | * file->private_data. | 262 | * file->private_data. |
| 263 | */ | 263 | */ |
| 264 | if (mnt) | 264 | if (mnt) { |
| 265 | cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags); | 265 | struct cifsFileInfo *pfile_info; |
| 266 | |||
| 267 | pfile_info = cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, | ||
| 268 | oflags); | ||
| 269 | if (pfile_info == NULL) | ||
| 270 | rc = -ENOMEM; | ||
| 271 | } | ||
| 266 | 272 | ||
| 267 | posix_open_ret: | 273 | posix_open_ret: |
| 268 | kfree(presp_data); | 274 | kfree(presp_data); |
| @@ -476,12 +482,15 @@ cifs_create_set_dentry: | |||
| 476 | /* mknod case - do not leave file open */ | 482 | /* mknod case - do not leave file open */ |
| 477 | CIFSSMBClose(xid, tcon, fileHandle); | 483 | CIFSSMBClose(xid, tcon, fileHandle); |
| 478 | } else if (!(posix_create) && (newinode)) { | 484 | } else if (!(posix_create) && (newinode)) { |
| 485 | struct cifsFileInfo *pfile_info; | ||
| 479 | /* | 486 | /* |
| 480 | * cifs_fill_filedata() takes care of setting cifsFileInfo | 487 | * cifs_fill_filedata() takes care of setting cifsFileInfo |
| 481 | * pointer to file->private_data. | 488 | * pointer to file->private_data. |
| 482 | */ | 489 | */ |
| 483 | cifs_new_fileinfo(newinode, fileHandle, NULL, nd->path.mnt, | 490 | pfile_info = cifs_new_fileinfo(newinode, fileHandle, NULL, |
| 484 | oflags); | 491 | nd->path.mnt, oflags); |
| 492 | if (pfile_info == NULL) | ||
| 493 | rc = -ENOMEM; | ||
| 485 | } | 494 | } |
| 486 | cifs_create_out: | 495 | cifs_create_out: |
| 487 | kfree(buf); | 496 | kfree(buf); |
