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

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
Greg Kroah-Hartman 2014-11-17 15:15:34 -08:00
parent 1e776f3183
commit ed7538e5a3
1 changed files with 2 additions and 1 deletions

View File

@ -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);