All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luiz Fernando N. Capitulino" <lcapitulino@prefeitura.sp.gov.br>
To: kernel-janitors@vger.kernel.org
Subject: [Kernel-janitors] [PATCH] - fix pci/probe.c possible NULL pointer.
Date: Thu, 27 May 2004 19:12:32 +0000	[thread overview]
Message-ID: <20040527191232.GA2249@lorien.prodam> (raw)

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]


 Hi,

 In drivers/pci/probe.c::pci_scan_bridge() the call for pci_alloc_child_bus()
can return NULL, but it is not handled by the function (detected by
Coverity's checker).

 The patch bellow fix that returning `max' if we got the NULL, but
I do not know if it is right. I guess it is, because in that case
the function will act in the same way as with `pass != 0'.

Signed-off by: Luiz Capitulino <lcapitulino@prefeitura.sp.gov.br>

 drivers/pci/probe.c |    2 ++
 1 files changed, 2 insertions(+)


diff -X dontdiff -Nparu a/drivers/pci/probe.c a~/drivers/pci/probe.c
--- a/drivers/pci/probe.c	2004-05-24 14:44:34.000000000 -0300
+++ a~/drivers/pci/probe.c	2004-05-26 19:51:50.000000000 -0300
@@ -366,6 +366,8 @@ int __devinit pci_scan_bridge(struct pci
 			return max;
 		busnr = (buses >> 8) & 0xFF;
 		child = pci_alloc_child_bus(bus, dev, busnr);
+		if (!child)
+			return max;
 		child->primary = buses & 0xFF;
 		child->subordinate = (buses >> 16) & 0xFF;
 		child->bridge_ctl = bctl;
-- 
Luiz Fernando N. Capitulino
<http://www.telecentros.sp.gov.br>

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

                 reply	other threads:[~2004-05-27 19:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040527191232.GA2249@lorien.prodam \
    --to=lcapitulino@prefeitura.sp.gov.br \
    --cc=kernel-janitors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.