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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;