Changeset bad8d41 in mainline for uspace/lib/usbdev/src/recognise.c


Ignore:
Timestamp:
2017-12-21T20:24:54Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Parents:
f04b5b3
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-21 18:24:59)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-21 20:24:54)
Message:

The "not-so-obvious" error handling tweaks.

File:
1 edited

Legend:

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

    rf04b5b3 rbad8d41  
    8888                char *str = NULL; \
    8989                int __rc = asprintf(&str, format, ##__VA_ARGS__); \
    90                 if (__rc > 0) { \
    91                         __rc = usb_add_match_id((match_ids), (score), str); \
    92                 } \
    93                 if (__rc != EOK) { \
    94                         free(str); \
    95                         return __rc; \
     90                if (__rc >= 0) { \
     91                        int __rc = usb_add_match_id((match_ids), (score), str); \
     92                        if (__rc != EOK) { \
     93                                free(str); \
     94                                return __rc; \
     95                        } \
     96                } else { \
     97                        return ENOMEM; \
    9698                } \
    9799        } while (0)
Note: See TracChangeset for help on using the changeset viewer.