rem: if (!partition) return B_ENTRY_NOT_FOUND; PartitionRegistrar registrar1(partition, true); PartitionRegistrar registrar2(partition->Device(), true); DeviceReadLocker locker(partition->Device(), true); return validate_create_child_partition(partition, changeCounter, offset, size, type, parameters);
add: status_t error = partition ? B_OK : B_ENTRY_NOT_FOUND; if (!error) { PartitionRegistrar registrar1(partition, true); PartitionRegistrar registrar2(partition->Device(), true); DeviceReadLocker locker(partition->Device(), true); error = validate_create_child_partition(partition, changeCounter, &offset, &size, type, parameters); } if (!error) { user_memcpy(_offset, &offset, sizeof(offset)); user_memcpy(_size, &size, sizeof(size)); } free(parameters); return error;
context: _kern_validate_create_child_partition(partition_id partitionID,									  int32 changeCounter, off_t *offset,									  off_t *size, const char *type,									  const char *parameters){	if (!offset || !size || !type)		return B_BAD_VALUE;	KDiskDeviceManager *manager = KDiskDeviceManager::Default();	// get the partition	KPartition *partition = manager->ReadLockPartition(partitionID);	if (!partition)		return B_ENTRY_NOT_FOUND;	PartitionRegistrar registrar1(partition, true);	PartitionRegistrar registrar2(partition->Device(), true);	DeviceReadLocker locker(partition->Device(), true);	return validate_create_child_partition(partition, changeCounter, offset,										   size, type, parameters);}