Ver código fonte

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

tags/v0.9.5
Michael Brown 16 anos atrás
pai
commit
df02c54f86
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4
    4
      src/drivers/infiniband/arbel.c

+ 4
- 4
src/drivers/infiniband/arbel.c Ver arquivo

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

Carregando…
Cancelar
Salvar