mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Subject: [PATCH] serial: ns16550_pci: fix possible read of uninitialized variable
Date: Wed, 12 Feb 2020 10:38:39 +0100	[thread overview]
Message-ID: <20200212093839.25968-1-ahmad@a3f.at> (raw)

When quirk->init is NULL, we evaluate an uninitialized rc.
Is we have already checked for rc < 0 at the point of assignment,
this if clause isn't needed. Remove it.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 drivers/serial/serial_ns16550_pci.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/serial/serial_ns16550_pci.c b/drivers/serial/serial_ns16550_pci.c
index d4b5bd8898b7..392a2810d815 100644
--- a/drivers/serial/serial_ns16550_pci.c
+++ b/drivers/serial/serial_ns16550_pci.c
@@ -3655,12 +3655,6 @@ pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
 	uart.pdata = xzalloc(sizeof(*uart.pdata));
 	uart.pdata->clock = board->base_baud * 16;
 
-	if (rc < 0) {
-		kfree(priv);
-		priv = ERR_PTR(rc);
-		goto err_deinit;
-	}
-
 	for (i = 0; i < nr_ports; i++) {
 		struct device_d *ns16550_dev;
 		struct resource *res;
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2020-02-12  9:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12  9:38 Ahmad Fatoum [this message]
2020-02-14  7:44 ` Sascha Hauer

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=20200212093839.25968-1-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    /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