[PATCH]Please review the patch
pradeep singh
pradeep.rautela at gmail.com
Fri Jun 22 02:12:08 CDT 2007
On 6/21/07, Matt Mackall <mpm at selenic.com> wrote:
> On Thu, Jun 21, 2007 at 04:28:42PM +0530, pradeep singh wrote:
[snip]
> >
> > This patch fixes this by checking for NULL in the test condition for, for loop.
>
> You probably want to instead check it before entering the loop:
Thanks Matt ,fixed that yesterday but could not get formatting correct
with gmail.
Is this correct now?
Signed-off-by: Pradeep Singh <pradeep.rautela at 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
Thanks
[snip]
--
Pradeep
More information about the Kernel-mentors
mailing list