[PATCH 00/12] staging: some memory-related patches

xkernel.wang@foxmail.com posted 12 patches 4 years ago
drivers/staging/r8188eu/core/rtw_cmd.c      | 16 +++---
drivers/staging/r8188eu/core/rtw_xmit.c     | 42 +++++++++++----
drivers/staging/r8188eu/include/rtw_xmit.h  |  2 +-
drivers/staging/r8188eu/os_dep/xmit_linux.c |  4 +-
drivers/staging/rtl8712/os_intfs.c          | 26 +++++++--
drivers/staging/rtl8712/recv_osdep.h        |  2 +-
drivers/staging/rtl8712/rtl871x_recv.c      |  6 +--
drivers/staging/rtl8712/rtl871x_xmit.c      | 27 +++++++---
drivers/staging/rtl8712/xmit_linux.c        |  3 +-
drivers/staging/rtl8723bs/core/rtw_cmd.c    | 17 +++---
drivers/staging/rtl8723bs/core/rtw_xmit.c   | 50 ++++++++++++-----
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 60 +++++++++++----------
12 files changed, 163 insertions(+), 92 deletions(-)
[PATCH 00/12] staging: some memory-related patches
Posted by xkernel.wang@foxmail.com 4 years ago
From: Xiaoke Wang <xkernel.wang@foxmail.com>

This is a collection about some memory-related bugs fixing.
In brief, there are two types about them.
First is some memory allocation functions are called without proper
checking, which may result in wrong memory access in the subsequent
running or some else.
Second is lacking proper error handling that does not release some
allocated resources, which may result in memory leak problems.

These issuses are similar, so they are put in this series together.
Note that most of them are sent as each separate patch before, this series
rebased them to the lasted version. While there are some inherent logical
relationships between 03~05/11~12.

Xiaoke Wang (12):
  staging: rtl8712: fix potential memory leak in
    r8712_xmit_resource_alloc()
  staging: rtl8712: fix potential memory leak in _r8712_init_xmit_priv()
  staging: rtl8712: fix potential memory leak in r8712_init_drv_sw()
  staging: rtl8712: change the type of _r8712_init_recv_priv()
  staging: rtl8712: add two validation check in r8712_init_drv_sw()
  staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()
  staging: rtl8723bs: fix potential memory leak in _rtw_init_xmit_priv()
  staging: rtl8723bs: fix potential memory leak in rtw_init_drv_sw()
  staging: r8188eu: fix a potential memory leak in _rtw_init_cmd_priv()
  staging: r8188eu: fix potential memory leak in
    rtw_os_xmit_resource_alloc()
  staging: r8188eu: fix potential memory leak in _rtw_init_xmit_priv()
  staging: r8188eu: check the return of kzalloc()

 drivers/staging/r8188eu/core/rtw_cmd.c      | 16 +++---
 drivers/staging/r8188eu/core/rtw_xmit.c     | 42 +++++++++++----
 drivers/staging/r8188eu/include/rtw_xmit.h  |  2 +-
 drivers/staging/r8188eu/os_dep/xmit_linux.c |  4 +-
 drivers/staging/rtl8712/os_intfs.c          | 26 +++++++--
 drivers/staging/rtl8712/recv_osdep.h        |  2 +-
 drivers/staging/rtl8712/rtl871x_recv.c      |  6 +--
 drivers/staging/rtl8712/rtl871x_xmit.c      | 27 +++++++---
 drivers/staging/rtl8712/xmit_linux.c        |  3 +-
 drivers/staging/rtl8723bs/core/rtw_cmd.c    | 17 +++---
 drivers/staging/rtl8723bs/core/rtw_xmit.c   | 50 ++++++++++++-----
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 60 +++++++++++----------
 12 files changed, 163 insertions(+), 92 deletions(-)

--
Re: [PATCH 00/12] staging: some memory-related patches
Posted by Greg KH 3 years, 11 months ago
On Tue, May 03, 2022 at 02:56:47PM +0800, xkernel.wang@foxmail.com wrote:
> From: Xiaoke Wang <xkernel.wang@foxmail.com>
> 
> This is a collection about some memory-related bugs fixing.
> In brief, there are two types about them.
> First is some memory allocation functions are called without proper
> checking, which may result in wrong memory access in the subsequent
> running or some else.
> Second is lacking proper error handling that does not release some
> allocated resources, which may result in memory leak problems.
> 
> These issuses are similar, so they are put in this series together.
> Note that most of them are sent as each separate patch before, this series
> rebased them to the lasted version. While there are some inherent logical
> relationships between 03~05/11~12.

Can you please look at Documentation/process/researcher-guidelines.rst
and update the changelog texts of these commits to provide the extra
information that this document requires of changes like this?

thanks,

greg k-h
Re: [PATCH 00/12] staging: some memory-related patches
Posted by xkernel.wang@foxmail.com 3 years, 11 months ago
On Monday, June 6, 2022 2:12 PM +0800, Greg KH <gregkh@linuxfoundation.org> wrote:
 > Can you please look at Documentation/process/researcher-guidelines.rst
> and update the changelog texts of these commits to provide the extra
> information that this document requires of changes like this?

Hi Greg,
Ok, I'll see what's missing.

In fact, I originally used my developing tool to find the lacking checks
for kzalloc(patch 12 in this series) and the other bugs are found manually
by myself for the purpose of improving code quality.

Now I am happy to find the bug for checking the return of kzalloc() is
fixed now, however, the patch to fix it didn't even consider potential
memory leaks. So I'm a little confused about why these patches from me are
suspended again and again.

Anyway, when I have time, I will rebase them and send new patches if they
are still there.

Regards,
Xiaoke Wang