Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early Beta of the Intel HD Audio Driver #13

Merged
merged 1 commit into from Jun 3, 2017

Conversation

TheSchemm
Copy link
Contributor

No description provided.

@jackpot51 jackpot51 merged commit 70fc136 into redox-os:master Jun 3, 2017
return Err("Could not map physical memory for buffer.");
} else {
unsafe {syscall::physfree(phys_addr, length);}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You return without freeing on error, and free pages when you succeed?
I'm not sure about the semantics of physmap and physfree, but this seems like a bug.

}

pub fn widget_type(&self) -> HDAWidgetType {
unsafe { mem::transmute( ((self.capabilities >> 20) & 0xF) as u8 )}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.capabilities comes from hardware, right? Buggy device may cause undefined behavior here by providing invalid value.

@TheSchemm
Copy link
Contributor Author

Thanks for the catch! I have fixed the memory issue and the capabilities will be patched according to the codes that I test on. Good catch and thanks for looking through it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants