From ed7538e5a36ee7b369cb0ab0616394cb2f892a9f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 17 Nov 2014 15:15:34 -0800 Subject: [PATCH] greybus: uart: handle NULL size requests in request_operation() Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/uart-gb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/uart-gb.c b/drivers/staging/greybus/uart-gb.c index 533c3c2..a4f745a 100644 --- a/drivers/staging/greybus/uart-gb.c +++ b/drivers/staging/greybus/uart-gb.c @@ -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); -- 2.7.4