Commit 47bda74a authored by Ji-Hun Kim's avatar Ji-Hun Kim Committed by Greg Kroah-Hartman

staging: ks7010: replace kmalloc() + memcpy() with kmemdup()

Use kmemdup rather than duplicating its implementation.
Signed-off-by: default avatarJi-Hun Kim <ji_hun.kim@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd6dad98
...@@ -589,11 +589,10 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index) ...@@ -589,11 +589,10 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
int ret; int ret;
unsigned char *data_buf; unsigned char *data_buf;
data_buf = kmalloc(sizeof(u32), GFP_KERNEL); data_buf = kmemdup(&index, sizeof(u32), GFP_KERNEL);
if (!data_buf) if (!data_buf)
return -ENOMEM; return -ENOMEM;
memcpy(data_buf, &index, sizeof(index));
ret = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index)); ret = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index));
if (ret) if (ret)
goto err_free_data_buf; goto err_free_data_buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment