oparams.fid = pfid;
        oparams.reconnect = false;
 
-       rc = SMB2_open(xid, &oparams, &srch_path, &oplock, NULL, NULL);
+       rc = SMB2_open(xid, &oparams, &srch_path, &oplock, NULL, NULL, NULL);
        if (rc == 0) {
                memcpy(tcon->prfid, pfid, sizeof(struct cifs_fid));
                tcon->valid_root_fid = true;
        oparms.reconnect = false;
 
        if (no_cached_open)
-               rc = SMB2_open(xid, &oparms, &srch_path, &oplock, NULL, NULL);
+               rc = SMB2_open(xid, &oparms, &srch_path, &oplock, NULL, NULL,
+                              NULL);
        else
                rc = open_shroot(xid, tcon, &fid);
 
        oparms.fid = &fid;
        oparms.reconnect = false;
 
-       rc = SMB2_open(xid, &oparms, &srch_path, &oplock, NULL, NULL);
+       rc = SMB2_open(xid, &oparms, &srch_path, &oplock, NULL, NULL, NULL);
        if (rc)
                return;
 
        oparms.fid = &fid;
        oparms.reconnect = false;
 
-       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
+       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL, NULL);
        if (rc) {
                kfree(utf16_path);
                return rc;
        oparms.fid = &fid;
        oparms.reconnect = false;
 
-       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
+       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL, NULL);
        kfree(utf16_path);
        if (rc) {
                cifs_dbg(FYI, "open failed rc=%d\n", rc);
        oparms.fid = &fid;
        oparms.reconnect = false;
 
-       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
+       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL, NULL);
        kfree(utf16_path);
        if (rc) {
                cifs_dbg(FYI, "open failed rc=%d\n", rc);
        oparms.fid = fid;
        oparms.reconnect = false;
 
-       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
+       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL, NULL);
        kfree(utf16_path);
        if (rc) {
                cifs_dbg(FYI, "open dir failed rc=%d\n", rc);
        oparms.fid = &fid;
        oparms.reconnect = false;
 
-       rc = SMB2_open(xid, &oparms, &srch_path, &oplock, NULL, NULL);
+       rc = SMB2_open(xid, &oparms, &srch_path, &oplock, NULL, NULL, NULL);
        if (rc)
                return rc;
        buf->f_type = SMB2_MAGIC_NUMBER;
        struct cifs_open_parms oparms;
        struct cifs_fid fid;
        struct kvec err_iov = {NULL, 0};
-       struct smb2_err_rsp *err_buf;
+       struct smb2_err_rsp *err_buf = NULL;
+       int resp_buftype;
        struct smb2_symlink_err_rsp *symlink;
        unsigned int sub_len;
        unsigned int sub_offset;
        oparms.fid = &fid;
        oparms.reconnect = false;
 
-       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, &err_iov);
-
+       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, &err_iov,
+                      &resp_buftype);
        if (!rc || !err_iov.iov_base) {
-               kfree(utf16_path);
-               return -ENOENT;
+               rc = -ENOENT;
+               goto querty_exit;
        }
 
        err_buf = err_iov.iov_base;
        if (le32_to_cpu(err_buf->ByteCount) < sizeof(struct smb2_symlink_err_rsp) ||
            err_iov.iov_len < SMB2_SYMLINK_STRUCT_SIZE) {
-               kfree(utf16_path);
-               return -ENOENT;
+               rc = -ENOENT;
+               goto querty_exit;
        }
 
        /* open must fail on symlink - reset rc */
        print_offset = le16_to_cpu(symlink->PrintNameOffset);
 
        if (err_iov.iov_len < SMB2_SYMLINK_STRUCT_SIZE + sub_offset + sub_len) {
-               kfree(utf16_path);
-               return -ENOENT;
+               rc = -ENOENT;
+               goto querty_exit;
        }
 
        if (err_iov.iov_len <
            SMB2_SYMLINK_STRUCT_SIZE + print_offset + print_len) {
-               kfree(utf16_path);
-               return -ENOENT;
+               rc = -ENOENT;
+               goto querty_exit;
        }
 
        *target_path = cifs_strndup_from_utf16(
                                (char *)symlink->PathBuffer + sub_offset,
                                sub_len, true, cifs_sb->local_nls);
        if (!(*target_path)) {
-               kfree(utf16_path);
-               return -ENOMEM;
+               rc = -ENOMEM;
+               goto querty_exit;
        }
        convert_delimiter(*target_path, '/');
        cifs_dbg(FYI, "%s: target path: %s\n", __func__, *target_path);
+
+ querty_exit:
+       free_rsp_buf(resp_buftype, err_buf);
        kfree(utf16_path);
        return rc;
 }
        oparms.fid = &fid;
        oparms.reconnect = false;
 
-       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
+       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL, NULL);
        kfree(utf16_path);
        if (!rc) {
                rc = SMB2_query_acl(xid, tlink_tcon(tlink), fid.persistent_fid,
        oparms.fid = &fid;
        oparms.reconnect = false;
 
-       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
+       rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL, NULL);
        kfree(utf16_path);
        if (!rc) {
                rc = SMB2_set_acl(xid, tlink_tcon(tlink), fid.persistent_fid,