Re: [PATCH 1/5] android/hal-audio: Add open/close_endpoint helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Szymon,

On 1 March 2014 12:51, Szymon Janc <szymon.janc@xxxxxxxxx> wrote:
> Hi Andrzej,
>
> On Friday 28 of February 2014 19:01:16 Andrzej Kaczmarek wrote:

<snip>

>> +     }
>> +
>> +     if (fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) < 0) {
>> +             error("fcntl(F_SETFL): %s (%d)", strerror(errno), errno);
>> +             return -errno;
>> +     }
>> +
>> +     return 0;
>> +}
>> +
>> +static bool open_endpoint(struct audio_endpoint *ep,
>> +                                             struct audio_input_config *cfg)
>> +{
>> +     struct audio_preset *preset;
>> +     const struct audio_codec *codec;
>> +     uint16_t mtu;
>> +     int fd;
>> +
>> +     if (ipc_open_stream_cmd(ep->id, &mtu, &fd, &preset) !=
>> +                                                     AUDIO_STATUS_SUCCESS)
>> +             return false;
>> +
>> +     if (!preset || fd < 0)
>
> If this can happen despite ipc_open_stream_cmd() returned success then freeing
> preset or closing fd should be handled here.

I'll remove this check since ipc_open_stream_cmd guarantees that both
preset and fd are valid on success.

BR,
Andrzej
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux