Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 732bf988 authored by Bryan Thompson's avatar Bryan Thompson Committed by Greg Kroah-Hartman
Browse files

staging: unisys: virtpci: Allocate memory using the size of the variable



Change two instances of using the sizeof a structure to the size of a specific variable when
allocating memory in virtpci.c

Signed-off-by: default avatarBryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 15c76967
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -256,7 +256,7 @@ static int add_vbus(struct add_vbus_guestpart *addparams)
	int ret;
	int ret;
	struct device *vbus;
	struct device *vbus;


	vbus = kzalloc(sizeof(struct device), GFP_ATOMIC);
	vbus = kzalloc(sizeof(*vbus), GFP_ATOMIC);


	POSTCODE_LINUX_2(VPCI_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
	POSTCODE_LINUX_2(VPCI_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
	if (!vbus)
	if (!vbus)
@@ -922,7 +922,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype,
	}
	}


	/* add a Virtual Device */
	/* add a Virtual Device */
	virtpcidev = kzalloc(sizeof(struct virtpci_dev), GFP_ATOMIC);
	virtpcidev = kzalloc(sizeof(*virtpcidev), GFP_ATOMIC);
	if (virtpcidev == NULL) {
	if (virtpcidev == NULL) {
		LOGERR("can't add device - malloc FALLED\n");
		LOGERR("can't add device - malloc FALLED\n");
		POSTCODE_LINUX_2(MALLOC_FAILURE_PC, POSTCODE_SEVERITY_ERR);
		POSTCODE_LINUX_2(MALLOC_FAILURE_PC, POSTCODE_SEVERITY_ERR);