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