Skip to content

Commit

Permalink
pata_macio: Delete an error message for a failed memory allocation in…
Browse files Browse the repository at this point in the history
… two functions

Omit an extra message 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: Tejun Heo <tj@kernel.org>
  • Loading branch information
Markus Elfring authored and Tejun Heo committed Feb 18, 2018
1 parent 533013d commit 3e34277
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/ata/pata_macio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,11 +1131,9 @@ static int pata_macio_attach(struct macio_dev *mdev,
/* Allocate and init private data structure */
priv = devm_kzalloc(&mdev->ofdev.dev,
sizeof(struct pata_macio_priv), GFP_KERNEL);
if (priv == NULL) {
dev_err(&mdev->ofdev.dev,
"Failed to allocate private memory\n");
if (!priv)
return -ENOMEM;
}

priv->node = of_node_get(mdev->ofdev.dev.of_node);
priv->mdev = mdev;
priv->dev = &mdev->ofdev.dev;
Expand Down Expand Up @@ -1277,11 +1275,9 @@ static int pata_macio_pci_attach(struct pci_dev *pdev,
/* Allocate and init private data structure */
priv = devm_kzalloc(&pdev->dev,
sizeof(struct pata_macio_priv), GFP_KERNEL);
if (priv == NULL) {
dev_err(&pdev->dev,
"Failed to allocate private memory\n");
if (!priv)
return -ENOMEM;
}

priv->node = of_node_get(np);
priv->pdev = pdev;
priv->dev = &pdev->dev;
Expand Down

0 comments on commit 3e34277

Please sign in to comment.