rem: if (!partition) return B_ENTRY_NOT_FOUND; PartitionRegistrar registrar1(partition, true); PartitionRegistrar registrar2(partition->Device(), true); DeviceWriteLocker locker(partition->Device(), true);  status_t error = validate_set_partition_content_parameters(partition, changeCounter, parameters); if (error != B_OK) return error;  error = partition->SetContentParameters(parameters); if (error != B_OK) return error; partition->Changed(B_PARTITION_CHANGED_CONTENT_PARAMETERS);  return partition->DiskSystem()->ShadowPartitionChanged( partition, B_PARTITION_SET_CONTENT_PARAMETERS);
add: status_t error = partition ? B_OK : B_ENTRY_NOT_FOUND; if (!error) { PartitionRegistrar registrar1(partition, true); PartitionRegistrar registrar2(partition->Device(), true); DeviceWriteLocker locker(partition->Device(), true);  error = validate_set_partition_content_parameters(partition, changeCounter, parameters); if (!error) {  error = partition->SetContentParameters(parameters); if (!error) { partition->Changed(B_PARTITION_CHANGED_CONTENT_PARAMETERS);  error = partition->DiskSystem()->ShadowPartitionChanged( partition, B_PARTITION_SET_CONTENT_PARAMETERS); } } } free(partition); return error;
context: _kern_set_partition_content_parameters(partition_id partitionID,									   int32 changeCounter,									   const char *parameters){	KDiskDeviceManager *manager = KDiskDeviceManager::Default();	// get the partition	KPartition *partition = manager->WriteLockPartition(partitionID);	if (!partition)		return B_ENTRY_NOT_FOUND;	PartitionRegistrar registrar1(partition, true);	PartitionRegistrar registrar2(partition->Device(), true);	DeviceWriteLocker locker(partition->Device(), true);	// check parameters	status_t error = validate_set_partition_content_parameters(partition,		changeCounter, parameters);	if (error != B_OK)		return error;	// set name	error = partition->SetContentParameters(parameters);	if (error != B_OK)		return error;	partition->Changed(B_PARTITION_CHANGED_CONTENT_PARAMETERS);	// implicit content disk system changes	return partition->DiskSystem()->ShadowPartitionChanged(		partition, B_PARTITION_SET_CONTENT_PARAMETERS);}