[lkml]   [2019]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] staging: rtl8723bs: remove unused code
From: Colin Ian King <>

There are two final hunks of code that are only built
if SDIO_DYNAMIC_ALLOC_MEM is defined however this is never
defined and if it was the code would lead to dereferencing
an uninitialized pointer oldmem. It appears that a previous
commit 1babeb0c3e59 ("Staging: rtl8723bs: Remove dead code")
removed some of the dead code but not all of it. Clean this
up by removing the final hunks.

Signed-off-by: Colin Ian King <>
drivers/staging/rtl8723bs/hal/sdio_ops.c | 10 ----------
1 file changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index 3fee34484577..92191e9789bb 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -428,9 +428,6 @@ static u32 sdio_read_port(
struct hal_com_data *hal;
u32 oldcnt;
- u8 *oldmem;
s32 err;

@@ -447,13 +444,6 @@ static u32 sdio_read_port(

err = _sd_read(intfhdl, addr, cnt, mem);

- if ((oldcnt != cnt) && (oldmem)) {
- memcpy(oldmem, mem, oldcnt);
- kfree(mem);
- }
if (err)
return _FAIL;
return _SUCCESS;
 \ /
  Last update: 2019-03-16 23:27    [W:0.024 / U:1.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site