diff options
| -rw-r--r-- | fs/cifs/smb2pdu.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 3efcd96b52c5..6b03e2d45d8e 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c | |||
| @@ -648,7 +648,7 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) | |||
| 648 | { | 648 | { |
| 649 | int rc = 0; | 649 | int rc = 0; |
| 650 | struct validate_negotiate_info_req vneg_inbuf; | 650 | struct validate_negotiate_info_req vneg_inbuf; |
| 651 | struct validate_negotiate_info_rsp *pneg_rsp; | 651 | struct validate_negotiate_info_rsp *pneg_rsp = NULL; |
| 652 | u32 rsplen; | 652 | u32 rsplen; |
| 653 | u32 inbuflen; /* max of 4 dialects */ | 653 | u32 inbuflen; /* max of 4 dialects */ |
| 654 | 654 | ||
| @@ -728,7 +728,7 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) | |||
| 728 | 728 | ||
| 729 | /* relax check since Mac returns max bufsize allowed on ioctl */ | 729 | /* relax check since Mac returns max bufsize allowed on ioctl */ |
| 730 | if (rsplen > CIFSMaxBufSize) | 730 | if (rsplen > CIFSMaxBufSize) |
| 731 | return -EIO; | 731 | goto err_rsp_free; |
| 732 | } | 732 | } |
| 733 | 733 | ||
| 734 | /* check validate negotiate info response matches what we got earlier */ | 734 | /* check validate negotiate info response matches what we got earlier */ |
| @@ -747,10 +747,13 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) | |||
| 747 | 747 | ||
| 748 | /* validate negotiate successful */ | 748 | /* validate negotiate successful */ |
| 749 | cifs_dbg(FYI, "validate negotiate info successful\n"); | 749 | cifs_dbg(FYI, "validate negotiate info successful\n"); |
| 750 | kfree(pneg_rsp); | ||
| 750 | return 0; | 751 | return 0; |
| 751 | 752 | ||
| 752 | vneg_out: | 753 | vneg_out: |
| 753 | cifs_dbg(VFS, "protocol revalidation - security settings mismatch\n"); | 754 | cifs_dbg(VFS, "protocol revalidation - security settings mismatch\n"); |
| 755 | err_rsp_free: | ||
| 756 | kfree(pneg_rsp); | ||
| 754 | return -EIO; | 757 | return -EIO; |
| 755 | } | 758 | } |
| 756 | 759 | ||
