提交 7e863061 编写于 作者: S Stephen Hemminger 提交者: Jeff Garzik

[PATCH] skge: use kzalloc

Can use kzalloc in skge driver.
Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 adba9e23
...@@ -3168,14 +3168,13 @@ static int __devinit skge_probe(struct pci_dev *pdev, ...@@ -3168,14 +3168,13 @@ static int __devinit skge_probe(struct pci_dev *pdev,
#endif #endif
err = -ENOMEM; err = -ENOMEM;
hw = kmalloc(sizeof(*hw), GFP_KERNEL); hw = kzalloc(sizeof(*hw), GFP_KERNEL);
if (!hw) { if (!hw) {
printk(KERN_ERR PFX "%s: cannot allocate hardware struct\n", printk(KERN_ERR PFX "%s: cannot allocate hardware struct\n",
pci_name(pdev)); pci_name(pdev));
goto err_out_free_regions; goto err_out_free_regions;
} }
memset(hw, 0, sizeof(*hw));
hw->pdev = pdev; hw->pdev = pdev;
spin_lock_init(&hw->phy_lock); spin_lock_init(&hw->phy_lock);
tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw); tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册