diff --git a/android/hidhost.c b/android/hidhost.c
index b8d2d8f..ea83733 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
static void handle_uhid_output(struct hid_device *dev,
struct uhid_output_req *output)
{
- int fd;
- uint8_t *req = NULL;
- uint8_t req_size = 0;
+ int fd, req_size;
+ uint8_t *req;
- if (!(dev->ctrl_io))
+ if (!dev->ctrl_io)
return;
req_size = 1 + output->size;
- req = g_try_malloc0(req_size);
+ req = malloc0(req_size);
if (!req)
return;
fd = g_io_channel_unix_get_fd(dev->ctrl_io);
if (write(fd, req, req_size) < 0)
- error("error writing set_report: %s (%d)",
- strerror(errno), errno);
+ error("hidhost: error writing set_report: %s (%d)",
+ strerror(errno), errno);
- g_free(req);
+ free(req);
}
static gboolean uhid_event_cb(GIOChannel *io, GIOCondition cond,