netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2.6.22-rc5] cxgb2: handle possible NULL pointer dereferencing, take 2
@ 2007-06-21 12:53 pradeep singh
  2007-06-21 13:00 ` pradeep singh
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: pradeep singh @ 2007-06-21 12:53 UTC (permalink / raw)
  To: trivial; +Cc: netdev, akpm, jgarzik

Hi,
This is second submission for a possible NULL dereference handling in
the Chelsio's 10G driver.

Thanks to Jens Axboe for pointing out my mistake of ignoring
subsequent dereferences in init_one routine.

Thanks

Signed-off-by: Pradeep Singh <pradeep.rautela@gmail.com>
---
 drivers/net/chelsio/cxgb2.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 231ce43..006c634 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -1022,6 +1022,11 @@ static int __devinit init_one(struct pci_dev *pdev,
 	mmio_start = pci_resource_start(pdev, 0);
 	mmio_len = pci_resource_len(pdev, 0);
 	bi = t1_get_board_info(ent->driver_data);
+	
+	if (!bi) {
+                CH_ERR("%s: Board info array index out of
range\n",pci_name(pdev));
+                goto out_disable_pdev;
+        }

 	for (i = 0; i < bi->port_number; ++i) {
 		struct net_device *netdev;
-- 
1.4.4.2

-- 
Pradeep

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-06-27  6:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-21 12:53 [PATCH v2.6.22-rc5] cxgb2: handle possible NULL pointer dereferencing, take 2 pradeep singh
2007-06-21 13:00 ` pradeep singh
2007-06-21 13:18 ` pradeep singh
2007-06-23 16:54   ` Andrew Morton
2007-06-25  5:46     ` pradeep singh
2007-06-25 22:34   ` Andrew Morton
2007-06-25 23:14     ` Jeff Garzik
2007-06-25 23:30       ` Andrew Morton
2007-06-25 23:32         ` Jeff Garzik
2007-06-26 16:24         ` Divy Le Ray
2007-06-25 23:15     ` Jeff Garzik
2007-06-26  0:38       ` Stephen Hemminger
2007-06-27  6:30 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).