提交 b8dd8654 编写于 作者: P Pascal COMBES 提交者: Greg Kroah-Hartman

Staging: crystalhd: Improve kzalloc calls in crystalhd_lnx.c

Replace sizeof(type) by sizeof(variable) in crystalhd_lnx.c.
Signed-off-by: NPascal COMBES <pascom@orange.fr>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9744f06b
...@@ -399,8 +399,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp) ...@@ -399,8 +399,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp)
/* Allocate general purpose ioctl pool. */ /* Allocate general purpose ioctl pool. */
for (i = 0; i < CHD_IODATA_POOL_SZ; i++) { for (i = 0; i < CHD_IODATA_POOL_SZ; i++) {
temp = kzalloc(sizeof(struct crystalhd_ioctl_data), temp = kzalloc(sizeof(*temp), GFP_KERNEL);
GFP_KERNEL);
if (!temp) { if (!temp) {
BCMLOG_ERR("ioctl data pool kzalloc failed\n"); BCMLOG_ERR("ioctl data pool kzalloc failed\n");
rc = -ENOMEM; rc = -ENOMEM;
...@@ -555,7 +554,7 @@ static int chd_dec_pci_probe(struct pci_dev *pdev, ...@@ -555,7 +554,7 @@ static int chd_dec_pci_probe(struct pci_dev *pdev,
pdev->vendor, pdev->device, pdev->subsystem_vendor, pdev->vendor, pdev->device, pdev->subsystem_vendor,
pdev->subsystem_device); pdev->subsystem_device);
pinfo = kzalloc(sizeof(struct crystalhd_adp), GFP_KERNEL); pinfo = kzalloc(sizeof(*pinfo), GFP_KERNEL);
if (!pinfo) { if (!pinfo) {
BCMLOG_ERR("Failed to allocate memory\n"); BCMLOG_ERR("Failed to allocate memory\n");
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册