From: Dan Carpenter <dan.carpenter@oracle.com>
To: Scott Branden <scott.branden@broadcom.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Desmond Yan <desmond.yan@broadcom.com>,
Olof Johansson <olof@lixom.net>, James Hu <james.hu@broadcom.com>,
bcm-kernel-feedback-list@broadcom.com,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] misc: bcm-vk: Fix a couple error codes in probe()
Date: Wed, 3 Feb 2021 17:42:53 +0300 [thread overview]
Message-ID: <YBpyEbmz00rjvT9S@mwanda> (raw)
These errors should return negative error codes instead of returning
success.
Fixes: 064ffc7c3939 ("misc: bcm-vk: add autoload support")
Fixes: 522f692686a7 ("misc: bcm-vk: add Broadcom VK driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/misc/bcm-vk/bcm_vk_dev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/bcm-vk/bcm_vk_dev.c b/drivers/misc/bcm-vk/bcm_vk_dev.c
index c3d2bba68ef1..a82a8927d92b 100644
--- a/drivers/misc/bcm-vk/bcm_vk_dev.c
+++ b/drivers/misc/bcm-vk/bcm_vk_dev.c
@@ -1358,6 +1358,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
vk->bar[i] = pci_ioremap_bar(pdev, i * 2);
if (!vk->bar[i]) {
dev_err(dev, "failed to remap BAR%d\n", i);
+ err = -ENOMEM;
goto err_iounmap;
}
}
@@ -1463,7 +1464,8 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
boot_status = vkread32(vk, BAR_0, BAR_BOOT_STATUS);
if (auto_load) {
if ((boot_status & BOOT_STATE_MASK) == BROM_RUNNING) {
- if (bcm_vk_trigger_autoload(vk))
+ err = bcm_vk_trigger_autoload(vk);
+ if (err)
goto err_bcm_vk_tty_exit;
} else {
dev_err(dev,
--
2.30.0
next reply other threads:[~2021-02-03 14:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 14:42 Dan Carpenter [this message]
2021-02-03 19:15 ` [PATCH] misc: bcm-vk: Fix a couple error codes in probe() Scott Branden
2021-02-03 20:05 ` Dan Carpenter
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=YBpyEbmz00rjvT9S@mwanda \
--to=dan.carpenter@oracle.com \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=desmond.yan@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=james.hu@broadcom.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
--cc=scott.branden@broadcom.com \
/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