mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05: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()
|
||||
{
|
||||
if (transfer_data_size() == 0)
|
||||
return;
|
||||
if (m_callback)
|
||||
m_callback(this);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue