提交 7c9eb691 编写于 作者: A Alan Cox 提交者: Greg Kroah-Hartman

Staging: sep: Use kzalloc when needed

Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 da14e551
...@@ -3343,16 +3343,13 @@ static int __devinit sep_probe(struct pci_dev *pdev, ...@@ -3343,16 +3343,13 @@ static int __devinit sep_probe(struct pci_dev *pdev,
} }
/* allocate the sep_device structure for this device */ /* allocate the sep_device structure for this device */
sep_dev = kmalloc(sizeof(struct sep_device), GFP_ATOMIC); sep_dev = kzalloc(sizeof(struct sep_device), GFP_ATOMIC);
if (sep_dev == NULL) { if (sep_dev == NULL) {
dev_warn(&pdev->dev, dev_warn(&pdev->dev,
"can't kmalloc the sep_device structure\n"); "can't kmalloc the sep_device structure\n");
return -ENOMEM; return -ENOMEM;
} }
/* zero out sep structure */
memset((void *)sep_dev, 0, sizeof(struct sep_device));
/* /*
* we're going to use another variable for actually * we're going to use another variable for actually
* working with the device; this way, if we have * working with the device; this way, if we have
...@@ -3365,8 +3362,6 @@ static int __devinit sep_probe(struct pci_dev *pdev, ...@@ -3365,8 +3362,6 @@ static int __devinit sep_probe(struct pci_dev *pdev,
if (pdev->device == MRST_PCI_DEVICE_ID) if (pdev->device == MRST_PCI_DEVICE_ID)
sep->mrst = 1; sep->mrst = 1;
else
sep->mrst = 0;
dev_dbg(&sep->pdev->dev, "PCI obtained, device being prepared\n"); dev_dbg(&sep->pdev->dev, "PCI obtained, device being prepared\n");
dev_dbg(&sep->pdev->dev, "revision is %d\n", sep->pdev->revision); dev_dbg(&sep->pdev->dev, "revision is %d\n", sep->pdev->revision);
...@@ -3423,7 +3418,6 @@ static int __devinit sep_probe(struct pci_dev *pdev, ...@@ -3423,7 +3418,6 @@ static int __devinit sep_probe(struct pci_dev *pdev,
goto end_function_deallocate_sep_shared_area; goto end_function_deallocate_sep_shared_area;
} }
} else { } else {
sep->rar_size = FAKE_RAR_SIZE; sep->rar_size = FAKE_RAR_SIZE;
sep->rar_addr = dma_alloc_coherent(NULL, sep->rar_addr = dma_alloc_coherent(NULL,
sep->rar_size, &sep->rar_bus, GFP_KERNEL); sep->rar_size, &sep->rar_bus, GFP_KERNEL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册