diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-08-21 13:25:47 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-08-21 13:25:47 +0000 |
commit | d595791da3d0ce8a20e638f3d0648ccdf78bb55a (patch) | |
tree | 7ab5f13cd0024fd9d5cc6e9c8c7302a4c7c9d10a /audio/pcm_bluetooth.c | |
parent | cae1e4ecd14d380252b0e00f71bc6cf2887ebd31 (diff) |
More cleanup
Diffstat (limited to 'audio/pcm_bluetooth.c')
-rw-r--r-- | audio/pcm_bluetooth.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c index 9bae8681..0547ee3c 100644 --- a/audio/pcm_bluetooth.c +++ b/audio/pcm_bluetooth.c @@ -863,13 +863,14 @@ static int bluetooth_a2dp_init(struct bluetooth_data *data, a2dp->sbc.subbands = sbc->subbands; a2dp->sbc.blocks = sbc->blocks; a2dp->sbc.bitpool = sbc->bitpool; + a2dp->pipefd[0] = -1; + a2dp->pipefd[1] = -1; - - if (pipe(a2dp->pipefd) != 0) + if (pipe(a2dp->pipefd) < 0) return -errno; - if (fcntl(a2dp->pipefd[0], F_SETFL, O_NONBLOCK) != 0) + if (fcntl(a2dp->pipefd[0], F_SETFL, O_NONBLOCK) < 0) return -errno; - if (fcntl(a2dp->pipefd[1], F_SETFL, O_NONBLOCK) != 0) + if (fcntl(a2dp->pipefd[1], F_SETFL, O_NONBLOCK) < 0) return -errno; return 0; @@ -1022,7 +1023,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(bluetooth) DBG("Bluetooth PCM plugin (%s)", stream == SND_PCM_STREAM_PLAYBACK ? "Playback" : "Capture"); - data = calloc(1, sizeof(struct bluetooth_data)); + data = malloc(sizeof(struct bluetooth_data)); if (!data) { err = -ENOMEM; goto error; |