diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2015-07-17 18:50:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-07-20 16:14:29 -0700 |
commit | 1c7658cf5165586acff901b7e6ef27d8d5f2818d (patch) | |
tree | 07d3ac15cf34097446652e7edfea5a001bcf2898 /drivers/staging/greybus/operation.c | |
parent | 93047af23c8389d1a63883dcb59cd8c2fd472b45 (diff) |
greybus: operation: fix atomic response allocation
Response allocation also needs a GFP-flags argument as a response is
allocated as part of an outgoing operation.
Fixes: 9aa174d202e5 ("operation: allow atomic operation allocations")
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/operation.c')
-rw-r--r-- | drivers/staging/greybus/operation.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index a99505cc21fa..0fe50d80b2db 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -426,7 +426,7 @@ static u8 gb_operation_errno_map(int errno) } bool gb_operation_response_alloc(struct gb_operation *operation, - size_t response_size) + size_t response_size, gfp_t gfp) { struct greybus_host_device *hd = operation->connection->hd; struct gb_operation_msg_hdr *request_header; @@ -434,8 +434,7 @@ bool gb_operation_response_alloc(struct gb_operation *operation, u8 type; type = operation->type | GB_MESSAGE_TYPE_RESPONSE; - response = gb_operation_message_alloc(hd, type, response_size, - GFP_KERNEL); + response = gb_operation_message_alloc(hd, type, response_size, gfp); if (!response) return false; response->operation = operation; @@ -497,8 +496,10 @@ gb_operation_create_common(struct gb_connection *connection, u8 type, /* Allocate the response buffer for outgoing operations */ if (!(op_flags & GB_OPERATION_FLAG_INCOMING)) { - if (!gb_operation_response_alloc(operation, response_size)) + if (!gb_operation_response_alloc(operation, response_size, + gfp_flags)) { goto err_request; + } } operation->flags = op_flags; @@ -734,7 +735,7 @@ static int gb_operation_response_send(struct gb_operation *operation, if (!operation->response && !gb_operation_is_unidirectional(operation)) { - if (!gb_operation_response_alloc(operation, 0)) + if (!gb_operation_response_alloc(operation, 0, GFP_KERNEL)) return -ENOMEM; } |