Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2997580pxy; Mon, 3 May 2021 12:38:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz85r0KEhvwmb7Zbl+xHrqO+8VWgL/VFcDi+103Zgh3m47JY2r6J1kk+zzOW7XTWpwgC6Q X-Received: by 2002:a50:ec89:: with SMTP id e9mr9279656edr.347.1620070693106; Mon, 03 May 2021 12:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620070693; cv=none; d=google.com; s=arc-20160816; b=BxmV7Dewav7RZWS4TfdaMVxE3hbATPHJxzVI4XsZJAhtBVMqQGEaxYYJH67omQcgC7 TLLuCYCqT0TWZfbnTKOlLIG7DEOBqrsgeNQBFwBRW4Vui0wfdoA8Q4SDMEUvKhPLL05N 4LNTHgFjDDoHjByQpz8QUGTdBHMXTxfThDoY1XINSfuZIMcVr447Sr1JjOHzV2CKWd9J t4OcHgt26igTeRegw1BXVGLm7LZsoyWS4dp4fgKd/wIuMQ+fE4PV94wIaXgBl/Pv9pFh uyl6vukEbxjJ5SSYb/OYlcoQjLElzfutX3BL+bYO0oa60m2KMjfwQKvp+J6HsvqLpWvd qG6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=/15ZZgVs4HWwrQnoXkLDtTe4rR3G5xM3bzUg9TCb5gA=; b=ezYqMMDiRmjx1sp2KZ8xDnTW8VGpFiNVW65HpF776Nzac28W0f1a6OMly9JrNcyFsE q9gWYOB/UNetrizkv3QCUCDz3XPSP4NVy9JRmpu/FFKts0/8Jn4YIKlX56KHEoeFqwEl KtGMM+m9aPvSelSdhBvUCdB6QC4sJnUm7jWafNe7O/9niwkrv42yhtpl7O5wP71kwEyv nF5Jk2VtFAJ2uRSQfhQEvGWD6dRpOiv8iJwFdcUQWnZ7yUhev9+gtaf+T31cwjR7DLNR mthYyE9Xi8vLlVfK4kroktICLane62cx6IGi4ZQ6Ij4XiyNjPOQQShOVi9KERQiF2L45 a6mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mhwZUQ+W; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si741964ejy.418.2021.05.03.12.37.49; Mon, 03 May 2021 12:38:13 -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=@gmail.com header.s=20161025 header.b=mhwZUQ+W; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbhECThL (ORCPT + 99 others); Mon, 3 May 2021 15:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbhECThK (ORCPT ); Mon, 3 May 2021 15:37:10 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAC68C06174A; Mon, 3 May 2021 12:36:16 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id o16so8265969ljp.3; Mon, 03 May 2021 12:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/15ZZgVs4HWwrQnoXkLDtTe4rR3G5xM3bzUg9TCb5gA=; b=mhwZUQ+Wna2bTzVcsyO/hJn7zgi/eLCeH+k76NUpMWmcIUA0AeuMrubne0kmeVoBAP x0sqhLptrE4+IzSI06xEanCrLQTTqczVfQlS7Q9xolDG2pmQPfd5z6fv6Jya5PkkspRh 6z/uSvyVUSPj7D+aY/+fKKXtAA020AeeowfW563Ug2mx6/86YL3z4eEvyKBT9MDw3Q+B hV8kOzDUzE5j+U/9ehHMGl950IiBSrLrafBE5bl/N5NQSRaulUFmjW3uP6YtK939m1xD UXXkk2fwH/gKS1QG7o4oJhycMOgAQoQO9++RGjCDrZmqUYg39rkSL9c73qPhZxtIhN69 Ayhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/15ZZgVs4HWwrQnoXkLDtTe4rR3G5xM3bzUg9TCb5gA=; b=Fq7a3MF8X1ZS/PluFVbKozV/CahwTybIMgkvPQslJE/OfnzEW5VtXWpm5hP8hrlXVZ e6CRW/ddBe8DXjppZbPVt7B/+0PcAeJDq2Gs8EXedK/nleOVPt8DMfvt55or9N04U4WL PBV3yjo440yYPxiRiZtD0wmoXsJAcQDPqcGMzBHwqBtXUnwpRuxS0iK8O6K/3Wdwcwse RGrNEjWdnC9O5pJxEvlGSB67FTRDjaUxl5N24cQGy2F+r5uogkZjada99N+0VSwFtuFp 5ZQkWSwskpiMbkHherRz3gBZ09tKNcAshmypxsysCcxGCSMH+2KmSTGYeB9AJHJv/C/r 6tlg== X-Gm-Message-State: AOAM532UYb9XRyWY5tHQfebEdtBVcN1BE7JV8tgAWdBUjnbmx+6U5vbM QKBqFM/4qdPGNbkh20XP7P0= X-Received: by 2002:a2e:97c3:: with SMTP id m3mr1029889ljj.231.1620070575377; Mon, 03 May 2021 12:36:15 -0700 (PDT) Received: from [192.168.0.131] ([194.183.54.57]) by smtp.gmail.com with ESMTPSA id q27sm402397ljm.127.2021.05.03.12.36.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 May 2021 12:36:14 -0700 (PDT) Subject: Re: [PATCH 09/69] leds: lp5523: check return value of lp5xx_read and jump to cleanup code To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Phillip Potter , stable , Linux LED Subsystem , Pavel Machek References: <20210503115736.2104747-1-gregkh@linuxfoundation.org> <20210503115736.2104747-10-gregkh@linuxfoundation.org> From: Jacek Anaszewski Message-ID: Date: Mon, 3 May 2021 21:36:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210503115736.2104747-10-gregkh@linuxfoundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/3/21 1:56 PM, Greg Kroah-Hartman wrote: > From: Phillip Potter > > 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: Jacek Anaszewski > Cc: stable > Signed-off-by: Phillip Potter > Signed-off-by: Greg Kroah-Hartman > --- > drivers/leds/leds-lp5523.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c > index 5036d7d5f3d4..b1590cb4a188 100644 > --- a/drivers/leds/leds-lp5523.c > +++ b/drivers/leds/leds-lp5523.c > @@ -305,7 +305,9 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip) > > /* 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) { > Acked-by: Jacek Anaszewski Cc: Pavel Machek , linux-leds@vger.kernel.org -- Best regards, Jacek Anaszewski