RE: [PATCH v2 wireless] wifi: rtw88: debugfs: don't vzalloc(0) when rsvd_page is read unconfigured

Ping-Ke Shih <[email protected]>
Newsgroups org.kernel.vger.linux-wireless
Message-ID <[email protected]>
Abdurrahman Karadag <[email protected]> wrote:
> Reading the rsvd_page debugfs entry before writing a page offset and
> count to it calls vzalloc() with a size of zero, because
> rsvd_page.page_num defaults to 0.  vmalloc warns about this:
> 
>   WARNING: mm/vmalloc.c:4019 at __vmalloc_node_range_noprof+0x9ac/0xa30
>   ...
>   Call Trace:
>    __vmalloc_node_noprof+0x4c/0x70
>    rtw_debugfs_get_rsvd_page+0x4c/0x110 [rtw88_core]
>    seq_read_iter+0x132/0x4b0
>    seq_read+0x12e/0x1c0
>    full_proxy_read+0x6f/0xc0
>    vfs_read+0xdd/0x490
> 
> rtw_fw_dump_fifo() would reject the zero size anyway, but only after
> the allocation.  Check for a zero buffer size first and print a short
> usage hint instead of allocating.
> 
> Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
> Signed-off-by: Abdurrahman Karadag <[email protected]>

Acked-by: Ping-Ke Shih <[email protected]>

> ---
> v2: no code change. Add the wireless target tree to the subject and Cc
>     the maintainers/blamed authors that v1 missed.

Actually, target tree of Realtek Wifi driver should be rtw-next or rtw. 

[1] https://github.com/pkshih/rtw.git rtw-next
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.