pci/hotplug: Delete error messages for a failed memory allocation in four functions
Subsystems (3)
PATCH 1/1 pci/hotplug: Delete error messages for a failed memory allocation in four functions
From: Markus Elfring <[email protected]>
Date: Fri, 29 Dec 2017 15:47:00 +0100
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 <[email protected]>
--- drivers/pci/hotplug/pciehp_hpc.c | 5 ++--- drivers/pci/hotplug/pnv_php.c | 8 +------- drivers/pci/hotplug/shpchp_core.c | 5 ++--- 3 files changed, 5 insertions(+), 13 deletions(-)
drivers/pci/hotplug/pciehp_hpc.c +2 -3
@@ -838,10 +838,9 @@ struct controller *pcie_init(struct pcie_device *dev)struct pci_dev *pdev = dev->port; ctrl =kzalloc (sizeof (*ctrl),GFP_KERNEL ); -if (!ctrl) { -dev_err (&dev->device,"%s: Out of memory\n" , __func__); +if (!ctrl) goto abort; - } + ctrl->pcie = dev;pcie_capability_read_dword (pdev,PCI_EXP_SLTCAP , &slot_cap);
drivers/pci/hotplug/pnv_php.c +1 -7
@@ -266,7 +266,6 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot) fdt1 =kzalloc (0x10000 ,GFP_KERNEL );if (!fdt1) { ret = -ENOMEM ; -dev_warn (&php_slot->pdev->dev,"Cannot alloc FDT blob\n" ); goto out; }
@@ -280,8 +279,6 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot) fdt =kzalloc (fdt_totalsize (fdt1),GFP_KERNEL );if (!fdt) { ret = -ENOMEM ; -dev_warn (&php_slot->pdev->dev,"Cannot %d bytes memory\n" , -fdt_totalsize (fdt1)); goto free_fdt1; }
@@ -756,11 +753,8 @@ static irqreturn_t pnv_php_interrupt(int irq, void *data)* fine as the PCI devices (PE) aren't functional any more. */ event =kzalloc (sizeof (*event),GFP_ATOMIC ); -if (!event) { -dev_warn (&pdev->dev,"PCI slot [%s] missed hotplug event 0x%04x\n" , - php_slot->name, sts); +if (!event)return IRQ_HANDLED ; - }dev_info (&pdev->dev,"PCI slot [%s] %s (IRQ: %d)\n" , php_slot->name, added ?"added" :"removed" , irq);
drivers/pci/hotplug/shpchp_core.c +2 -3
@@ -305,10 +305,9 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)return -ENODEV ; ctrl =kzalloc (sizeof (*ctrl),GFP_KERNEL ); -if (!ctrl) { -dev_err (&pdev->dev,"%s: Out of memory\n" , __func__); +if (!ctrl) goto err_out_none; - } +INIT_LIST_HEAD (&ctrl->slot_list); rc =shpc_init (ctrl, pdev);
Signature · 1 line
2.15.1