Skip to content

Commit

Permalink
[hermon] Fix off-by-one error in the failure path in hermon_probe()
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Brown committed Oct 1, 2008
1 parent e899f10 commit 76f6cad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/drivers/infiniband/hermon.c
Expand Up @@ -2252,9 +2252,9 @@ static int hermon_probe ( struct pci_device *pci,

return 0;

i = ( HERMON_NUM_PORTS - 1 );
i = HERMON_NUM_PORTS;
err_register_ibdev:
for ( ; i >= 0 ; i-- )
for ( i-- ; i >= 0 ; i-- )
unregister_ibdev ( hermon->ibdev[i] );
hermon_destroy_eq ( hermon );
err_create_eq:
Expand All @@ -2270,9 +2270,9 @@ static int hermon_probe ( struct pci_device *pci,
err_mailbox_out:
free_dma ( hermon->mailbox_in, HERMON_MBOX_SIZE );
err_mailbox_in:
i = ( HERMON_NUM_PORTS - 1 );
i = HERMON_NUM_PORTS;
err_alloc_ibdev:
for ( ; i >= 0 ; i-- )
for ( i-- ; i >= 0 ; i-- )
ibdev_put ( hermon->ibdev[i] );
free ( hermon );
err_alloc_hermon:
Expand Down

0 comments on commit 76f6cad

Please sign in to comment.