mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 17:17:04 -04:00
greybus: uart: handle NULL size requests in request_operation()
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user