mirror of https://github.com/thesofproject/sof.git
probe-app: bail out if opening file fails
Do not blindly call fwrite without checking whether file open succeeded or not. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
parent
89039c6bff
commit
e2a5d925ba
|
@ -297,6 +297,13 @@ void parse_data(char *file_in)
|
||||||
packet->buffer_id,
|
packet->buffer_id,
|
||||||
packet->format);
|
packet->format);
|
||||||
|
|
||||||
|
if (file < 0) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"unable to open file for %u\n",
|
||||||
|
packet->buffer_id);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
fwrite(packet->data,
|
fwrite(packet->data,
|
||||||
sizeof(uint32_t),
|
sizeof(uint32_t),
|
||||||
packet->data_size_bytes /
|
packet->data_size_bytes /
|
||||||
|
|
Loading…
Reference in New Issue