Commit ed7538e5 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

greybus: uart: handle NULL size requests in request_operation()

Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 1e776f31
......@@ -177,7 +177,8 @@ static int request_operation(struct gb_connection *connection, int type,
ret = -EIO;
} else {
/* Good request, so copy to the caller's buffer */
memcpy(response, local_response, response_size);
if (response_size && response)
memcpy(response, local_response, response_size);
}
out:
gb_operation_destroy(operation);
......
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