提交 47bda74a 编写于 作者: J Ji-Hun Kim 提交者: Greg Kroah-Hartman

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

Use kmemdup rather than duplicating its implementation.
Signed-off-by: NJi-Hun Kim <ji_hun.kim@samsung.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 bd6dad98
......@@ -589,11 +589,10 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
int ret;
unsigned char *data_buf;
data_buf = kmalloc(sizeof(u32), GFP_KERNEL);
data_buf = kmemdup(&index, sizeof(u32), GFP_KERNEL);
if (!data_buf)
return -ENOMEM;
memcpy(data_buf, &index, sizeof(index));
ret = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index));
if (ret)
goto err_free_data_buf;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册