From: Johan Hovold Date: Wed, 27 Jul 2016 14:37:20 +0000 (+0200) Subject: greybus: es2: fix arpc response-allocation error handling X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~93 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=fcba5d04c87c5c0174f159d26b295a46bfb6da58;p=linux.git greybus: es2: fix arpc response-allocation error handling 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 Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c index afc2d6c8ec5c..130549f9d74d 100644 --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@ -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;