mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 17:25:06 +00:00
Kernel: Assert that device major/minor hasn't already been registered
It would be a bug to have multiple devices with the same major/minor so let's have an assertion for that.
This commit is contained in:
parent
8621304447
commit
2e38df7bd1
1 changed files with 3 additions and 1 deletions
|
@ -29,7 +29,9 @@ Device::Device(unsigned major, unsigned minor)
|
|||
: m_major(major)
|
||||
, m_minor(minor)
|
||||
{
|
||||
all_devices().set(encoded_device(m_major, m_minor), this);
|
||||
u32 device_id = encoded_device(major, minor);
|
||||
ASSERT(!all_devices().contains(device_id));
|
||||
all_devices().set(device_id, this);
|
||||
}
|
||||
|
||||
Device::~Device()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue