(vdisk->next->lun == scsidev->lun))
return 0;
}
- tmpvdisk = kmalloc(sizeof(struct virtdisk_info), GFP_ATOMIC);
+ tmpvdisk = kzalloc(sizeof(struct virtdisk_info), GFP_ATOMIC);
if (!tmpvdisk) { /* error allocating */
LOGERR("Could not allocate memory for disk\n");
return 0;
}
- memset(tmpvdisk, 0, sizeof(struct virtdisk_info));
+
tmpvdisk->channel = scsidev->channel;
tmpvdisk->id = scsidev->id;
tmpvdisk->lun = scsidev->lun;
}
/* add a Virtual Device */
- virtpcidev = kmalloc(sizeof(struct virtpci_dev), GFP_ATOMIC);
+ virtpcidev = kzalloc(sizeof(struct virtpci_dev), GFP_ATOMIC);
if (virtpcidev == NULL) {
LOGERR("can't add device - malloc FALLED\n");
POSTCODE_LINUX_2(MALLOC_FAILURE_PC, POSTCODE_SEVERITY_ERR);
return 0;
}
- memset(virtpcidev, 0, sizeof(struct virtpci_dev));
-
/* initialize stuff unique to virtpci_dev struct */
virtpcidev->devtype = devtype;
if (devtype == VIRTHBA_TYPE) {
*tryAgain = TRUE;
RETPTR(NULL);
}
- ctx = kmalloc(allocbytes, GFP_KERNEL|__GFP_NORETRY);
+ ctx = kzalloc(allocbytes, GFP_KERNEL|__GFP_NORETRY);
if (ctx == NULL) {
ERRDRV("%s (%s:%d) - failed to allocate %d bytes",
__func__, __FILE__, __LINE__, allocbytes);
*tryAgain = TRUE;
RETPTR(NULL);
}
- memset(ctx, 0, allocbytes);
+
ctx->allocbytes = allocbytes;
ctx->param_bytes = bytes;
ctx->curr = NULL;
POSTCODE_SEVERITY_ERR);
RETINT(-CONTROLVM_RESP_ERROR_ALREADY_DONE);
}
- pBusInfo = kmalloc(sizeof(VISORCHIPSET_BUS_INFO), GFP_KERNEL);
+ pBusInfo = kzalloc(sizeof(VISORCHIPSET_BUS_INFO), GFP_KERNEL);
if (pBusInfo == NULL) {
- LOGERR("CONTROLVM_BUS_CREATE Failed: bus %lu kmalloc failed",
+ LOGERR("CONTROLVM_BUS_CREATE Failed: bus %lu kzalloc failed",
busNo);
POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
POSTCODE_SEVERITY_ERR);
RETINT(-CONTROLVM_RESP_ERROR_KMALLOC_FAILED);
}
- memset(pBusInfo, 0, sizeof(VISORCHIPSET_BUS_INFO));
INIT_LIST_HEAD(&pBusInfo->entry);
pBusInfo->busNo = busNo;
pBusInfo->devNo = cmd->createBus.deviceCount;
POSTCODE_SEVERITY_ERR);
RETINT(-CONTROLVM_RESP_ERROR_BUS_INVALID);
}
- pDevInfo = kmalloc(sizeof(VISORCHIPSET_DEVICE_INFO), GFP_KERNEL);
+ pDevInfo = kzalloc(sizeof(VISORCHIPSET_DEVICE_INFO), GFP_KERNEL);
if (pDevInfo == NULL) {
LOGERR("CONTROLVM_DEVICE_CREATE Failed: busNo=%lu, devNo=%lu kmaloc failed",
busNo, devNo);
POSTCODE_SEVERITY_ERR);
RETINT(-CONTROLVM_RESP_ERROR_KMALLOC_FAILED);
}
- memset(pDevInfo, 0, sizeof(VISORCHIPSET_DEVICE_INFO));
+
INIT_LIST_HEAD(&pDevInfo->entry);
pDevInfo->busNo = busNo;
pDevInfo->devNo = devNo;
__func__, offset, nbytes);
return NULL;
}
- memregion = kmalloc(sizeof(MEMREGION), GFP_KERNEL|__GFP_NORETRY);
+ memregion = kzalloc(sizeof(MEMREGION), GFP_KERNEL|__GFP_NORETRY);
if (memregion == NULL) {
ERRDRV("%s allocation failed", __func__);
return NULL;
}
- memset(memregion, 0, sizeof(MEMREGION));
+
memregion->physaddr = parent->physaddr + offset;
memregion->nbytes = nbytes;
memregion->mapped = ((u8 *) (parent->mapped)) + offset;