mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +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
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/430e987078 Pull-request: https://github.com/SerenityOS/serenity/pull/21085 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/FireFox317 Reviewed-by: https://github.com/Hendiadyoin1 ✅ Reviewed-by: https://github.com/gmta ✅
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…
Reference in a new issue