[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <05fa56cb-843e-39bd-847d-1b31b5a726b5@users.sourceforge.net>
Date: Sat, 27 Aug 2016 18:12:33 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: Christian Bornträger <borntraeger@...ibm.com>
Cc: kvm@...r.kernel.org, linux-s390@...r.kernel.org,
Cornelia Huck <cornelia.huck@...ibm.com>,
David Hildenbrand <dahi@...ux.vnet.ibm.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: Re: KVM-S390: Less function calls in kvm_s390_import_bp_data() after
error detection
>> @@ -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
Powered by blists - more mailing lists