Changeset 5917859c in mainline


Ignore:
Timestamp:
2011-10-14T22:55:09Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
49bd7ae2
Parents:
aaf835d
Message:

libusbdev: Fix uninitialized pipes_count if there are no interfaces.

Make asserts more meaningful.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/devdrv.c

    raaf835d r5917859c  
    333333        int rc;
    334334
    335         size_t pipe_count = count_other_pipes(endpoints);
     335        const size_t pipe_count = count_other_pipes(endpoints);
    336336        if (pipe_count == 0) {
     337                *pipes_count_ptr = pipe_count;
    337338                *pipes_ptr = NULL;
    338339                return EOK;
     
    445446{
    446447        assert(dev != NULL);
    447         assert(((pipes != NULL) && (pipes_count > 0))
    448             || ((pipes == NULL) && (pipes_count == 0)));
    449448
    450449        if (pipes_count == 0) {
     450                assert(pipes == NULL);
    451451                return EOK;
    452452        }
     453        assert(pipes != NULL);
    453454
    454455        int rc;
Note: See TracChangeset for help on using the changeset viewer.