Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c22cbec0 authored by Shraddha Barke's avatar Shraddha Barke Committed by Greg Kroah-Hartman
Browse files

Staging: wilc1000: wilc_msgqueue: Use kmemdup instead of kmalloc and memcpy



Replace kmalloc and memcpy with kmemdup.
Problem found using coccicheck

Signed-off-by: default avatarShraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 39823a50
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -80,12 +80,12 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
		return -ENOMEM;
	pstrMessage->u32Length = u32SendBufferSize;
	pstrMessage->pstrNext = NULL;
	pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC);
	pstrMessage->pvBuffer = kmemdup(pvSendBuffer, u32SendBufferSize,
					GFP_ATOMIC);
	if (!pstrMessage->pvBuffer) {
		result = -ENOMEM;
		goto ERRORHANDLER;
	}
	memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize);

	/* add it to the message queue */
	if (!pHandle->pstrMessageList) {