]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
staging: rtl8723bs: Fix a resource leak in sd_int_dpc
authorXiangyang Zhang <xyz.sun.ok@gmail.com>
Mon, 28 Jun 2021 15:22:39 +0000 (23:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Aug 2021 11:19:43 +0000 (13:19 +0200)
commit 990e4ad3ddcb72216caeddd6e62c5f45a21e8121 upstream.

The "c2h_evt" variable is not freed when function call
"c2h_evt_read_88xx" failed

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210628152239.5475-1-xyz.sun.ok@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/hal/sdio_ops.c

index d6b93e1f78d8a9b65bdd13be1797cd21b85e178d..8aac87598e62042d0bdae47dce91b1a1e434c9f3 100644 (file)
@@ -1077,6 +1077,8 @@ void sd_int_dpc(struct adapter *adapter)
                                } else {
                                        rtw_c2h_wk_cmd(adapter, (u8 *)c2h_evt);
                                }
+                       } else {
+                               kfree(c2h_evt);
                        }
                } else {
                        /* Error handling for malloc fail */