summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorXiangyang Zhang <xyz.sun.ok@gmail.com>2021-06-28 23:22:39 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-21 11:40:00 +0200
commit990e4ad3ddcb72216caeddd6e62c5f45a21e8121 (patch)
tree2ee1a103eee1bd4570f4baaef1a35a848a3aade5 /drivers
parent2734d6c1b1a089fb593ef6a23d4b70903526fe0c (diff)
staging: rtl8723bs: Fix a resource leak in sd_int_dpc
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rtl8723bs/hal/sdio_ops.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index 2dd251ce177e..a545832a468e 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -909,6 +909,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 */