Browse Source

[arbel] Fix off-by-one error in the failure path in arbel_probe()

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

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

2183
 
2183
 
2184
 	return 0;
2184
 	return 0;
2185
 
2185
 
2186
-	i = ( ARBEL_NUM_PORTS - 1 );
2186
+	i = ARBEL_NUM_PORTS;
2187
  err_register_ibdev:
2187
  err_register_ibdev:
2188
-	for ( ; i >= 0 ; i-- )
2188
+	for ( i-- ; i >= 0 ; i-- )
2189
 		unregister_ibdev ( arbel->ibdev[i] );
2189
 		unregister_ibdev ( arbel->ibdev[i] );
2190
 	arbel_destroy_eq ( arbel );
2190
 	arbel_destroy_eq ( arbel );
2191
  err_create_eq:
2191
  err_create_eq:
2201
  err_mailbox_out:
2201
  err_mailbox_out:
2202
 	free_dma ( arbel->mailbox_in, ARBEL_MBOX_SIZE );
2202
 	free_dma ( arbel->mailbox_in, ARBEL_MBOX_SIZE );
2203
  err_mailbox_in:
2203
  err_mailbox_in:
2204
-	i = ( ARBEL_NUM_PORTS - 1 );
2204
+	i = ARBEL_NUM_PORTS;
2205
  err_alloc_ibdev:
2205
  err_alloc_ibdev:
2206
-	for ( ; i >= 0 ; i-- )
2206
+	for ( i-- ; i >= 0 ; i-- )
2207
 		ibdev_put ( arbel->ibdev[i] );
2207
 		ibdev_put ( arbel->ibdev[i] );
2208
 	free ( arbel );
2208
 	free ( arbel );
2209
  err_alloc_arbel:
2209
  err_alloc_arbel:

Loading…
Cancel
Save