diff options
| author | Bryan Thompson <bryan.thompson@unisys.com> | 2014-10-30 23:18:48 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-30 23:35:35 +0300 |
| commit | 732bf98833d8a3f13a658e24513ca5661a4be62f (patch) | |
| tree | 490f5436f8c0b9cce3c06fc9810d5ef088213652 | |
| parent | 15c769671739919226bb8aa2b7e23c5df7603086 (diff) | |
| download | linux-732bf98833d8a3f13a658e24513ca5661a4be62f.tar.xz | |
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: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/unisys/virtpci/virtpci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 560639a715ca..3cfa7671ec06 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -256,7 +256,7 @@ static int add_vbus(struct add_vbus_guestpart *addparams) int ret; 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); if (!vbus) @@ -922,7 +922,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, } /* add a Virtual Device */ - virtpcidev = kzalloc(sizeof(struct virtpci_dev), GFP_ATOMIC); + virtpcidev = kzalloc(sizeof(*virtpcidev), GFP_ATOMIC); if (virtpcidev == NULL) { LOGERR("can't add device - malloc FALLED\n"); POSTCODE_LINUX_2(MALLOC_FAILURE_PC, POSTCODE_SEVERITY_ERR); |
