Re: [PATCH] HID: roccat: free buffered reports when destroying device

Jiri Kosina <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.linux-input,org.kernel.vger.stable
Message-ID <[email protected]>
On Fri, 31 Jul 2026, raoxu wrote:

> From: Xu Rao <[email protected]>
> 
> roccat_report_event() duplicates each report with kmemdup() and stores
> the allocation in a circular-buffer slot. The allocation is released only
> when that slot is reused.
> 
> The device destruction paths free struct roccat_device without releasing
> reports still stored in cbuf[]. This makes those allocations unreachable
> and leaks up to ROCCAT_CBUF_SIZE report buffers per device.
> 
> Add a small destructor that frees every buffered report before freeing the
> device, and use it in both paths that can destroy a registered device.
> 
> Fixes: 206f5f2fcb5f ("HID: roccat: propagate special events of roccat hardware to userspace")
> Cc: [email protected]
> Signed-off-by: Xu Rao <[email protected]>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.