From: Greg Kroah-Hartman Date: Mon, 17 Nov 2014 23:15:34 +0000 (-0800) Subject: greybus: uart: handle NULL size requests in request_operation() X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~1877 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ed7538e5a36ee7b369cb0ab0616394cb2f892a9f;p=karo-tx-linux.git greybus: uart: handle NULL size requests in request_operation() Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/uart-gb.c b/drivers/staging/greybus/uart-gb.c index 533c3c20d095..a4f745afa885 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);