diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2015-07-14 15:43:24 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-07-15 12:39:13 -0700 |
commit | 9a586bd2bb80a268345cc8ccfa702413359ece06 (patch) | |
tree | 536e2c6dabd59b02397fb895ac30514c063eb16c /drivers/staging/greybus/operation.c | |
parent | fffc151381473384629d78cb89b7f7bbb9dc53b0 (diff) | |
download | op-kernel-dev-9a586bd2bb80a268345cc8ccfa702413359ece06.zip op-kernel-dev-9a586bd2bb80a268345cc8ccfa702413359ece06.tar.gz |
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>
Diffstat (limited to 'drivers/staging/greybus/operation.c')
-rw-r--r-- | drivers/staging/greybus/operation.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index 41aec76..081694c 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -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; } |