mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-15 00:04:29 +08:00
client/player: add error code handling to transport_recv()
It is necessary to add return value check as in sock_send(). Found with the SVACE static analysis tool.
This commit is contained in:
parent
ba70a116d9
commit
12525371ef
@ -4514,7 +4514,13 @@ static bool transport_recv(struct io *io, void *user_data)
|
||||
uint8_t buf[1024];
|
||||
int ret, len;
|
||||
|
||||
ret = read(io_get_fd(io), buf, sizeof(buf));
|
||||
ret = io_get_fd(io);
|
||||
if (ret < 0) {
|
||||
bt_shell_printf("io_get_fd() returned %d\n", ret);
|
||||
return true;
|
||||
}
|
||||
|
||||
ret = read(ret, buf, sizeof(buf));
|
||||
if (ret < 0) {
|
||||
bt_shell_printf("Failed to read: %s (%d)\n", strerror(errno),
|
||||
-errno);
|
||||
|
Loading…
Reference in New Issue
Block a user