Changeset b77931d in mainline for uspace/lib/usbdev/src/devdrv.c
- Timestamp:
- 2011-11-05T16:08:01Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d176b1d
- Parents:
- ab27e01
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devdrv.c
rab27e01 rb77931d 361 361 /* Now allocate and fully initialize. */ 362 362 for (i = 0; i < pipe_count; i++) { 363 pipes[i].pipe = malloc(sizeof(usb_pipe_t));364 if (pipes[i].pipe == NULL) {365 rc = ENOMEM;366 goto rollback_free_only;367 }368 363 pipes[i].description = endpoints[i]; 369 364 pipes[i].interface_no = interface_no; … … 392 387 for (i = 0; i < pipe_count; i++) { 393 388 if (pipes[i].present) { 394 rc = usb_pipe_register( pipes[i].pipe,389 rc = usb_pipe_register(&pipes[i].pipe, 395 390 pipes[i].descriptor->poll_interval, &hc_conn); 396 391 if (rc != EOK) { … … 420 415 for (i = 0; i < pipe_count; i++) { 421 416 if (pipes[i].present) { 422 usb_pipe_unregister( pipes[i].pipe, &hc_conn);417 usb_pipe_unregister(&pipes[i].pipe, &hc_conn); 423 418 } 424 419 } … … 434 429 */ 435 430 rollback_free_only: 436 for (i = 0; i < pipe_count; i++) {437 if (pipes[i].pipe != NULL) {438 free(pipes[i].pipe);439 }440 }441 431 free(pipes); 442 432 … … 480 470 i, pipes[i].present ? "" : "not "); 481 471 if (pipes[i].present) 482 usb_pipe_unregister(pipes[i].pipe, &hc_conn); 483 free(pipes[i].pipe); 472 usb_pipe_unregister(&pipes[i].pipe, &hc_conn); 484 473 } 485 474
Note:
See TracChangeset
for help on using the changeset viewer.