Commit 9a586bd2 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

greybus: operation: clean up create-incoming error path



Clean up gb_operation_create_incoming error path by returning
immediately on allocation failures.

Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent fffc1513
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -511,10 +511,11 @@ gb_operation_create_incoming(struct gb_connection *connection, u16 id,

	operation = gb_operation_create_common(connection, type,
					request_size, 0, flags, GFP_ATOMIC);
	if (operation) {
	if (!operation)
		return NULL;

	operation->id = id;
	memcpy(operation->request->header, data, size);
	}

	return operation;
}