Re: [PATCH] KVM: selftests: Add 'malloc' failure check in config_name

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


> This patch will add the malloc failure checking

* Please use a corresponding imperative wording for the change description.

* Would you like to add the tag “Fixes” accordingly?

> +++ b/tools/testing/selftests/kvm/get-reg-list.c
> @@ -66,6 +66,7 @@ static const char *config_name(struct vcpu_reg_list *c)
>  		len += strlen(s->name) + 1;
>  	c->name = malloc(len);
> +	TEST_ASSERT(c->name, "-ENOMEM when allocating config name");

Can “errno” be relevant for the error message construction?


[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