Kernel: Fix unaligned access in xHCI controller initialization

This commit is contained in:
Bananymous 2024-11-21 13:46:09 +02:00
parent 1253e2a458
commit 5750f87396
1 changed files with 7 additions and 1 deletions

View File

@ -159,7 +159,13 @@ namespace Kernel
{ {
auto& protocol = reinterpret_cast<volatile XHCI::SupportedPrococolCap&>(ext_cap); auto& protocol = reinterpret_cast<volatile XHCI::SupportedPrococolCap&>(ext_cap);
if (protocol.name_string != *reinterpret_cast<const uint32_t*>("USB ")) const uint32_t target_name_string {
('U' << 0) |
('S' << 8) |
('B' << 16) |
(' ' << 24)
};
if (protocol.name_string != target_name_string)
{ {
dwarnln("Invalid port protocol name string"); dwarnln("Invalid port protocol name string");
return BAN::Error::from_errno(EFAULT); return BAN::Error::from_errno(EFAULT);