Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3542468pxj; Mon, 24 May 2021 09:01:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh/q7mhRVvniX2g3xcPnXoq9x8JE2BBmN9Q+KVU2L0mze3NBw1oPoQ8Xd7W0MiLoU24vKs X-Received: by 2002:a92:c5aa:: with SMTP id r10mr18974615ilt.89.1621872113020; Mon, 24 May 2021 09:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872113; cv=none; d=google.com; s=arc-20160816; b=Lut8/9GWr7bAoYPP2uA741rHVgwASQs0fMlZCZZe8hS0E2ylhUAeXKH3trjGLgRlE9 LYOdzV59cR1aWuvTYzUYQVE0hKpk6lQtKU//ynv4E/BUhGi+EB8j7rjXaIoHVZJpVYuT PkEMvooMTcqyrvR2nLYrpwnIIWw9hrQHJkZIECDi7138975W/7AQgB2ChfzUFv0/M7TU zvzVNy+DchnGcqRZmSLdafQDp0d9KPyGZOCLbrk1vy2n2lG1tr+3JvicwZTsRhJjO1yo tAAoqBfcf/4sMmtQrsrf0ny+jnc03M3d+MSWhB67zHfAXDgkRO1Reo2wGlPtTNBXbWY5 UJrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NC8KulwuKglOLxWlWd8Q/OiV8s3iJFrJKcRBwm8/Xtg=; b=geXLGb7XhZqRYlUfAbi0nRZUqwjYaCGcnBZBWIEHcOhu48CITgPnwmPDQ0sXafdaWP XJS3oWbfS0uY4zkcibkN+mLDgjGVqDqhKqm6y6A48X3l65VBLk2vHrRLax2/3OTPxVZz OhytPe+98cXtaP3I17iPLdGLmcdNU8/6WBFbsDHMG2sUzIsG+FlQQMgFyeGvg4wFDOeF lJKFIT0rxo1sDbyAHS0bNxPXxBiPzMc0N5UAcZn+/ynUZ0m29FYUqsWk1sXlWb80ypWI 4F7o4incNQc7rQgas6D3Z8dfZHxxWS1gGwoekUwD5A2dyuubqHiawSSInIgjBi+VfHXi 4QnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=faKK4dE3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si14383391jan.100.2021.05.24.09.01.39; Mon, 24 May 2021 09:01:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=faKK4dE3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236082AbhEXQCg (ORCPT + 99 others); Mon, 24 May 2021 12:02:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:40492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235148AbhEXPzz (ORCPT ); Mon, 24 May 2021 11:55:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B5B761944; Mon, 24 May 2021 15:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870948; bh=0DVwXL7PYrs3JfPmlESgZ3BmiRo0C+ub21RL2mKSP9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=faKK4dE3xH0nzKENNG+o3wHwChrP3+dvq+1e1EzbJeRayWvn06zW/TMonU8rHlYei 2M7zgHijPB3Dlj3N9UiTxfX336WkHkQJ1xFLPrU55nOmsULvw+NkRB/BKQMpQK6ITA nAgFTpfA/T27gQT/daaTQJb4aON2NcBLmRLbhs1A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacek Anaszewski , Phillip Potter Subject: [PATCH 5.10 092/104] leds: lp5523: check return value of lp5xx_read and jump to cleanup code Date: Mon, 24 May 2021 17:26:27 +0200 Message-Id: <20210524152335.899552362@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152332.844251980@linuxfoundation.org> References: <20210524152332.844251980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Phillip Potter commit 6647f7a06eb030a2384ec71f0bb2e78854afabfe upstream. Check return value of lp5xx_read and if non-zero, jump to code at end of the function, causing lp5523_stop_all_engines to be executed before returning the error value up the call chain. This fixes the original commit (248b57015f35) which was reverted due to the University of Minnesota problems. Cc: stable Acked-by: Jacek Anaszewski Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210503115736.2104747-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- drivers/leds/leds-lp5523.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/leds/leds-lp5523.c +++ b/drivers/leds/leds-lp5523.c @@ -305,7 +305,9 @@ static int lp5523_init_program_engine(st /* Let the programs run for couple of ms and check the engine status */ usleep_range(3000, 6000); - lp55xx_read(chip, LP5523_REG_STATUS, &status); + ret = lp55xx_read(chip, LP5523_REG_STATUS, &status); + if (ret) + goto out; status &= LP5523_ENG_STATUS_MASK; if (status != LP5523_ENG_STATUS_MASK) {