kernel: LegacyDevice: SetHooks() needs a non-null fDeviceModule
fix gcc analyzer warning Change-Id: Ic2aaeebb516f680ba40c343c01d5be1a9232d46d Reviewed-on: https://review.haiku-os.org/c/haiku/+/7907 Haiku-Format: Haiku-format Bot <[email protected]> Tested-by: Commit checker robot <[email protected]> Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
@@ -1251,13 +1251,14 @@ LegacyDevice::LegacyDevice(legacy_driver* driver, const char* path,
|
||||
fRemovedFromParent(false)
|
||||
{
|
||||
fDeviceModule = (device_module_info*)malloc(sizeof(device_module_info));
|
||||
if (fDeviceModule != NULL)
|
||||
if (fDeviceModule != NULL) {
|
||||
memset(fDeviceModule, 0, sizeof(device_module_info));
|
||||
SetHooks(hooks);
|
||||
}
|
||||
|
||||
fDeviceData = this;
|
||||
fPath = strdup(path);
|
||||
|
||||
SetHooks(hooks);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user