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>
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;
}