vme: ca91cx42: Delete eight error messages for a failed memory allocation
Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Martyn Welch <martyn@welchs.me.uk>
This commit is contained in:
Родитель
2444d37fb0
Коммит
85fd4939e5
|
@ -535,8 +535,6 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
|
||||||
if (image->bus_resource.name == NULL) {
|
if (image->bus_resource.name == NULL) {
|
||||||
image->bus_resource.name = kmalloc(VMENAMSIZ+3, GFP_ATOMIC);
|
image->bus_resource.name = kmalloc(VMENAMSIZ+3, GFP_ATOMIC);
|
||||||
if (image->bus_resource.name == NULL) {
|
if (image->bus_resource.name == NULL) {
|
||||||
dev_err(ca91cx42_bridge->parent, "Unable to allocate "
|
|
||||||
"memory for resource name\n");
|
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto err_name;
|
goto err_name;
|
||||||
}
|
}
|
||||||
|
@ -1038,8 +1036,6 @@ static int ca91cx42_dma_list_add(struct vme_dma_list *list,
|
||||||
/* XXX descriptor must be aligned on 64-bit boundaries */
|
/* XXX descriptor must be aligned on 64-bit boundaries */
|
||||||
entry = kmalloc(sizeof(struct ca91cx42_dma_entry), GFP_KERNEL);
|
entry = kmalloc(sizeof(struct ca91cx42_dma_entry), GFP_KERNEL);
|
||||||
if (entry == NULL) {
|
if (entry == NULL) {
|
||||||
dev_err(dev, "Failed to allocate memory for dma resource "
|
|
||||||
"structure\n");
|
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto err_mem;
|
goto err_mem;
|
||||||
}
|
}
|
||||||
|
@ -1621,8 +1617,6 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
ca91cx42_bridge = kzalloc(sizeof(struct vme_bridge), GFP_KERNEL);
|
ca91cx42_bridge = kzalloc(sizeof(struct vme_bridge), GFP_KERNEL);
|
||||||
|
|
||||||
if (ca91cx42_bridge == NULL) {
|
if (ca91cx42_bridge == NULL) {
|
||||||
dev_err(&pdev->dev, "Failed to allocate memory for device "
|
|
||||||
"structure\n");
|
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto err_struct;
|
goto err_struct;
|
||||||
}
|
}
|
||||||
|
@ -1631,8 +1625,6 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
ca91cx42_device = kzalloc(sizeof(struct ca91cx42_driver), GFP_KERNEL);
|
ca91cx42_device = kzalloc(sizeof(struct ca91cx42_driver), GFP_KERNEL);
|
||||||
|
|
||||||
if (ca91cx42_device == NULL) {
|
if (ca91cx42_device == NULL) {
|
||||||
dev_err(&pdev->dev, "Failed to allocate memory for device "
|
|
||||||
"structure\n");
|
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto err_driver;
|
goto err_driver;
|
||||||
}
|
}
|
||||||
|
@ -1691,8 +1683,6 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
master_image = kmalloc(sizeof(struct vme_master_resource),
|
master_image = kmalloc(sizeof(struct vme_master_resource),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (master_image == NULL) {
|
if (master_image == NULL) {
|
||||||
dev_err(&pdev->dev, "Failed to allocate memory for "
|
|
||||||
"master resource structure\n");
|
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto err_master;
|
goto err_master;
|
||||||
}
|
}
|
||||||
|
@ -1717,8 +1707,6 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
slave_image = kmalloc(sizeof(struct vme_slave_resource),
|
slave_image = kmalloc(sizeof(struct vme_slave_resource),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (slave_image == NULL) {
|
if (slave_image == NULL) {
|
||||||
dev_err(&pdev->dev, "Failed to allocate memory for "
|
|
||||||
"slave resource structure\n");
|
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto err_slave;
|
goto err_slave;
|
||||||
}
|
}
|
||||||
|
@ -1744,8 +1732,6 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
dma_ctrlr = kmalloc(sizeof(struct vme_dma_resource),
|
dma_ctrlr = kmalloc(sizeof(struct vme_dma_resource),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (dma_ctrlr == NULL) {
|
if (dma_ctrlr == NULL) {
|
||||||
dev_err(&pdev->dev, "Failed to allocate memory for "
|
|
||||||
"dma resource structure\n");
|
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto err_dma;
|
goto err_dma;
|
||||||
}
|
}
|
||||||
|
@ -1764,8 +1750,6 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
/* Add location monitor to list */
|
/* Add location monitor to list */
|
||||||
lm = kmalloc(sizeof(struct vme_lm_resource), GFP_KERNEL);
|
lm = kmalloc(sizeof(struct vme_lm_resource), GFP_KERNEL);
|
||||||
if (lm == NULL) {
|
if (lm == NULL) {
|
||||||
dev_err(&pdev->dev, "Failed to allocate memory for "
|
|
||||||
"location monitor resource structure\n");
|
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto err_lm;
|
goto err_lm;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче