Re: KVM-S390: Less function calls in kvm_s390_import_bp_data() after error detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> @@ -273,10 +273,12 @@ int kvm_s390_import_bp_data(struct kvm_vcpu *vcpu,
>>  	vcpu->arch.guestdbg.nr_hw_wp = nr_wp;
>>  	vcpu->arch.guestdbg.hw_wp_info = wp_info;
>>  	return 0;
>> -error:
>> -	kfree(bp_data);
>> -	kfree(wp_info);
>> +free_bp_info:
>>  	kfree(bp_info);
>> +free_wp_info:
>> +	kfree(wp_info);
>> +free_bp_data:
>> +	kfree(bp_data);
>>  	return ret;
>>  }
> 
> I agree with Cornelia,

This is generally fine.


> while it seems correct from a technical point of view,

Thanks for another bit of acknowledgement.


> it will make the code harder to maintain.

I agree that there some efforts and challenges involved.


> For example if we ever add a new malloc and remove another one

Do you see any changes coming from this direction?


> over time we would need to reshuffle the labels

This can occasionally happen, can't it?


> and this did went wrong several times in the past.

Would you like to add any corresponding software development experiences
to discussions around a topic like "CodingStyle: add some more error
handling guidelines"?

https://www.spinics.net/lists/linux-doc/msg39307.html
http://marc.info/?l=linux-doc&m=147187538413914

Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux