Commit 269df046 authored by ChenXiaoSong's avatar ChenXiaoSong Committed by Steve French
Browse files

smb/server: fix return value of smb2_ioctl()



__process_request() will not print error messages if smb2_ioctl()
always returns 0.

Fix this by returning the correct value at the end of function.

Signed-off-by: default avatarChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent dafe22bc
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -8154,7 +8154,7 @@ int smb2_ioctl(struct ksmbd_work *work)
		id = req->VolatileFileId;

	if (req->Flags != cpu_to_le32(SMB2_0_IOCTL_IS_FSCTL)) {
		rsp->hdr.Status = STATUS_NOT_SUPPORTED;
		ret = -EOPNOTSUPP;
		goto out;
	}

@@ -8174,8 +8174,9 @@ int smb2_ioctl(struct ksmbd_work *work)
	case FSCTL_DFS_GET_REFERRALS:
	case FSCTL_DFS_GET_REFERRALS_EX:
		/* Not support DFS yet */
		ret = -EOPNOTSUPP;
		rsp->hdr.Status = STATUS_FS_DRIVER_REQUIRED;
		goto out;
		goto out2;
	case FSCTL_CREATE_OR_GET_OBJECT_ID:
	{
		struct file_object_buf_type1_ioctl_rsp *obj_buf;
@@ -8465,8 +8466,10 @@ int smb2_ioctl(struct ksmbd_work *work)
		rsp->hdr.Status = STATUS_BUFFER_TOO_SMALL;
	else if (ret < 0 || rsp->hdr.Status == 0)
		rsp->hdr.Status = STATUS_INVALID_PARAMETER;

out2:
	smb2_set_err_rsp(work);
	return 0;
	return ret;
}

/**