[PATCH v4.14.y] HID: debug: fix the ring buffer implementation