From: Markus Elfring <Markus.Elfring@web.de>
To: linux-ide@vger.kernel.org, Damien Le Moal <dlemoal@kernel.org>,
Niklas Cassel <cassel@kernel.org>,
Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] ata: pata_octeon_cf: Use common error handling code in octeon_cf_probe()
Date: Tue, 17 Sep 2024 13:50:09 +0200 [thread overview]
Message-ID: <4ca111f2-9b38-47a1-88d5-7dfaedcc6ea5@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 17 Sep 2024 13:43:24 +0200
Add a label so that a bit of exception handling can be better reused
in a subsequent if branch of this function implementation.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/ata/pata_octeon_cf.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index 0bb9607e7348..62289f6aef95 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -848,14 +848,13 @@ static int octeon_cf_probe(struct platform_device *pdev)
struct resource *res_dma;
int i;
res_dma = platform_get_resource(dma_dev, IORESOURCE_MEM, 0);
- if (!res_dma) {
- put_device(&dma_dev->dev);
- of_node_put(dma_node);
- return -EINVAL;
- }
+ if (!res_dma)
+ goto put_device;
+
cf_port->dma_base = (u64)devm_ioremap(&pdev->dev, res_dma->start,
resource_size(res_dma));
if (!cf_port->dma_base) {
+put_device:
put_device(&dma_dev->dev);
of_node_put(dma_node);
return -EINVAL;
--
2.46.0
next reply other threads:[~2024-09-17 11:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-17 11:50 Markus Elfring [this message]
2024-09-17 17:43 ` [PATCH] ata: pata_octeon_cf: Use common error handling code in octeon_cf_probe() Sergey Shtylyov
2024-09-17 20:44 ` Sergey Shtylyov
2024-09-18 12:35 ` Sergey Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ca111f2-9b38-47a1-88d5-7dfaedcc6ea5@web.de \
--to=markus.elfring@web.de \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s.shtylyov@omp.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox