Changeset b893cd6 in mainline


Ignore:
Timestamp:
2013-04-03T19:01:53Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aab8e3d3
Parents:
a94de68
Message:

hound: add null checks

Location:
uspace/srv/audio/hound
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/audio_sink.h

    ra94de68 rb893cd6  
    5959static inline audio_sink_t * audio_sink_list_instance(link_t *l)
    6060{
    61         return list_get_instance(l, audio_sink_t, link);
     61        return l ? list_get_instance(l, audio_sink_t, link) : NULL;
    6262}
    6363
  • uspace/srv/audio/hound/audio_source.c

    ra94de68 rb893cd6  
    5959        list_initialize(&source->connections);
    6060        source->name = str_dup(name);
     61        if (!source->name)
     62                return ENOMEM;
    6163        source->private_data = data;
    6264        source->connection_change = connection_change;
  • uspace/srv/audio/hound/audio_source.h

    ra94de68 rb893cd6  
    6060static inline audio_source_t * audio_source_list_instance(link_t *l)
    6161{
    62         return list_get_instance(l, audio_source_t, link);
     62        return l ? list_get_instance(l, audio_source_t, link) : NULL;
    6363}
    6464
  • uspace/srv/audio/hound/connection.c

    ra94de68 rb893cd6  
    5454                list_append(&conn->sink_link, &sink->connections);
    5555                audio_sink_set_format(sink, audio_source_format(source));
    56                 source->connection_change(source, true);
    57                 sink->connection_change(sink, true);
     56                if (source->connection_change)
     57                        source->connection_change(source, true);
     58                if (sink->connection_change)
     59                        sink->connection_change(sink, true);
    5860        }
    5961        return conn;
Note: See TracChangeset for help on using the changeset viewer.