mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
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:
parent
e7c1148ec6
commit
430e987078
1 changed files with 2 additions and 0 deletions
|
@ -61,6 +61,8 @@ ErrorOr<void> Transfer::write_buffer(u16 len, UserOrKernelBuffer data)
|
||||||
|
|
||||||
void Transfer::invoke_async_callback()
|
void Transfer::invoke_async_callback()
|
||||||
{
|
{
|
||||||
|
if (transfer_data_size() == 0)
|
||||||
|
return;
|
||||||
if (m_callback)
|
if (m_callback)
|
||||||
m_callback(this);
|
m_callback(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue