Skip to content

Commit

Permalink
staging: rtl8723bs: Fix a resource leak in sd_int_dpc
Browse files Browse the repository at this point in the history
commit 990e4ad upstream.

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

Fixes: 554c0a3 ("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>
  • Loading branch information
shellbombs authored and gregkh committed Aug 12, 2021
1 parent 7a4e7a6 commit 125b1d8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/rtl8723bs/hal/sdio_ops.c
Expand Up @@ -921,6 +921,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 */
Expand Down

0 comments on commit 125b1d8

Please sign in to comment.