From: Christian Engelmayer Date: Sun, 18 May 2014 23:00:40 +0000 (-0700) Subject: Input: ims-pcu - fix uninitialized use of 'error' in ims_pcu_buffers_alloc() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=19318de1daf25aa1ca4fe76e1d7ac834f1bfb0c4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Input: ims-pcu - fix uninitialized use of 'error' in ims_pcu_buffers_alloc() In case allocation via usb_alloc_coherent() fails in ims_pcu_buffers_alloc(), the function jumps to the exit path without initializing local variable 'error' that is used as return value. Detected by Coverity - CID 1016531. Signed-off-by: Christian Engelmayer Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c index 5a736397d9c8..719410feb84b 100644 --- a/drivers/input/misc/ims-pcu.c +++ b/drivers/input/misc/ims-pcu.c @@ -1566,6 +1566,7 @@ static int ims_pcu_buffers_alloc(struct ims_pcu *pcu) if (!pcu->urb_ctrl_buf) { dev_err(pcu->dev, "Failed to allocate memory for read buffer\n"); + error = -ENOMEM; goto err_free_urb_out_buf; }