intel_extreme: Fix crash of driver on multiple open
* open_count only got raised on initial open, subsequent opens didn't increment the counter thus when they exited the driver unloaded causing app_server to crash * Thanks to hamishm for pointing out that the if checks the pre-increment number * Resolves #10452
This commit is contained in:
parent
7b59f29e9e
commit
bcbd6e6cfe
@ -124,7 +124,7 @@ device_open(const char* name, uint32 /*flags*/, void** _cookie)
|
||||
|
||||
mutex_lock(&gLock);
|
||||
|
||||
if (info->open_count == 0) {
|
||||
if (info->open_count++ == 0) {
|
||||
// this device has been opened for the first time, so
|
||||
// we allocate needed resources and initialize the structure
|
||||
info->init_status = intel_extreme_init(*info);
|
||||
@ -133,8 +133,6 @@ device_open(const char* name, uint32 /*flags*/, void** _cookie)
|
||||
add_debugger_command("ie_reg", getset_register,
|
||||
"dumps or sets the specified intel_extreme register");
|
||||
#endif
|
||||
|
||||
info->open_count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user