Revert "We can not access cb_data when status is CANCELLED"
[libsmb2.git] / lib / libsmb2.c
index f3d60b1af773be3bb24374a166c02c72a224353c..6a3f2d27e8e0c90e5df6fbc0af517ad84d5d5a9c 100644 (file)
@@ -1177,10 +1177,6 @@ read_cb(struct smb2_context *smb2, int status,
         struct rw_data *rd = private_data;
         struct smb2_read_reply *rep = command_data;
 
-        if (status == SMB2_STATUS_CANCELLED) {
-                free(rd);
-                return;
-        }
         if (status && status != SMB2_STATUS_END_OF_FILE) {
                 smb2_set_error(smb2, "Read/Write failed with (0x%08x) %s",
                                status, nterror_to_str(status));
@@ -1708,10 +1704,6 @@ getinfo_cb_1(struct smb2_context *smb2, int status,
 {
         struct stat_cb_data *stat_data = private_data;
 
-        if (status == SMB2_STATUS_CANCELLED) {
-                return;
-        }
-
         if (stat_data->status == SMB2_STATUS_SUCCESS) {
                 stat_data->status = status;
         }
@@ -2258,11 +2250,6 @@ disconnect_cb_2(struct smb2_context *smb2, int status,
 {
         struct disconnect_data *dc_data = private_data;
 
-        if (status == SMB2_STATUS_CANCELLED) {
-                free(dc_data);
-                return;
-        }
-
         dc_data->cb(smb2, 0, NULL, dc_data->cb_data);
         free(dc_data);
         if (smb2->change_fd) {
@@ -2279,11 +2266,6 @@ disconnect_cb_1(struct smb2_context *smb2, int status,
         struct disconnect_data *dc_data = private_data;
         struct smb2_pdu *pdu;
 
-        if (status == SMB2_STATUS_CANCELLED) {
-                free(dc_data);
-                return;
-        }
-
         pdu = smb2_cmd_logoff_async(smb2, disconnect_cb_2, dc_data);
         if (pdu == NULL) {
                 dc_data->cb(smb2, -ENOMEM, NULL, dc_data->cb_data);