1
0
Fork 0

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: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
hifive-unleashed-5.1
Johan Hovold 2015-07-14 15:43:24 +02:00 committed by Greg Kroah-Hartman
parent fffc151381
commit 9a586bd2bb
1 changed files with 5 additions and 4 deletions

View File

@ -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) {
operation->id = id;
memcpy(operation->request->header, data, size);
}
if (!operation)
return NULL;
operation->id = id;
memcpy(operation->request->header, data, size);
return operation;
}