Browse Source

[hermon] Fix off-by-one error in the failure path in hermon_probe()

tags/v0.9.5
Michael Brown 16 years ago
parent
commit
76f6cad8af
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      src/drivers/infiniband/hermon.c

+ 4
- 4
src/drivers/infiniband/hermon.c View File

2252
 
2252
 
2253
 	return 0;
2253
 	return 0;
2254
 
2254
 
2255
-	i = ( HERMON_NUM_PORTS - 1 );
2255
+	i = HERMON_NUM_PORTS;
2256
  err_register_ibdev:
2256
  err_register_ibdev:
2257
-	for ( ; i >= 0 ; i-- )
2257
+	for ( i-- ; i >= 0 ; i-- )
2258
 		unregister_ibdev ( hermon->ibdev[i] );
2258
 		unregister_ibdev ( hermon->ibdev[i] );
2259
 	hermon_destroy_eq ( hermon );
2259
 	hermon_destroy_eq ( hermon );
2260
  err_create_eq:
2260
  err_create_eq:
2270
  err_mailbox_out:
2270
  err_mailbox_out:
2271
 	free_dma ( hermon->mailbox_in, HERMON_MBOX_SIZE );
2271
 	free_dma ( hermon->mailbox_in, HERMON_MBOX_SIZE );
2272
  err_mailbox_in:
2272
  err_mailbox_in:
2273
-	i = ( HERMON_NUM_PORTS - 1 );
2273
+	i = HERMON_NUM_PORTS;
2274
  err_alloc_ibdev:
2274
  err_alloc_ibdev:
2275
-	for ( ; i >= 0 ; i-- )
2275
+	for ( i-- ; i >= 0 ; i-- )
2276
 		ibdev_put ( hermon->ibdev[i] );
2276
 		ibdev_put ( hermon->ibdev[i] );
2277
 	free ( hermon );
2277
 	free ( hermon );
2278
  err_alloc_hermon:
2278
  err_alloc_hermon:

Loading…
Cancel
Save