Kernel/USB: Don't invoke async callback if transfer data size is 0

We can't do anything valuable with such "transfer" so just discard it.
This commit is contained in:
Liav A 2023-09-29 09:35:17 +03:00 committed by Jelle Raaijmakers
parent e7c1148ec6
commit 430e987078
Notes: sideshowbarker 2024-07-17 02:06:40 +09:00

View file

@ -61,6 +61,8 @@ ErrorOr<void> Transfer::write_buffer(u16 len, UserOrKernelBuffer data)
void Transfer::invoke_async_callback()
{
if (transfer_data_size() == 0)
return;
if (m_callback)
m_callback(this);
}