]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
greybus: es2: fix arpc response-allocation error handling
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 27 Jul 2016 14:37:20 +0000 (16:37 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 28 Jul 2016 17:04:06 +0000 (10:04 -0700)
The wrong pointer was checked for allocation failures when allocating
the ARPC response buffer, something which would lead to allocation
failures going undetected.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/es2.c

index afc2d6c8ec5cd1001ef82c6aa6d05ec23ab7b464..130549f9d74def9fe030d68b04974839c524fb1c 100644 (file)
@@ -1100,7 +1100,7 @@ static struct arpc *arpc_alloc(void *payload, u16 size, u8 type)
                goto err_free_rpc;
 
        rpc->resp = kzalloc(sizeof(*rpc->resp), GFP_KERNEL);
-       if (!rpc->req)
+       if (!rpc->resp)
                goto err_free_req;
 
        rpc->req->type = type;