diff --git a/dev_hidraw.c b/dev_hidraw.c index 2cd49c3..26d7f8c 100644 --- a/dev_hidraw.c +++ b/dev_hidraw.c @@ -43,6 +43,12 @@ static int dev_hidraw_new_from_fd(int fd, dev_hidraw_t **const out_dev) { } res = ioctl((*out_dev)->fd, HIDIOCGRDESC, &(*out_dev)->rdesc); + if (res < 0) { + perror("Error getting Report Descriptor"); + goto dev_hidraw_new_from_fd_err; + } + + res = ioctl((*out_dev)->fd, HIDIOCGRDESCSIZE, &(*out_dev)->rdesc.size); if (res < 0) { perror("Error getting Report Descriptor"); goto dev_hidraw_new_from_fd_err;