Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3533818pxj; Mon, 24 May 2021 08:50:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWModjdBJzpy9vSh8rZTnNl43bDU/EPsJnlvXdFAZ3FIp9+CfdP98RW2TLTkpHb4EmGm50 X-Received: by 2002:a05:6638:1650:: with SMTP id a16mr24718489jat.23.1621871448548; Mon, 24 May 2021 08:50:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621871448; cv=none; d=google.com; s=arc-20160816; b=FUWUmzUT9hPVrwZ4UFBWGXmPJpuRHsCxu9tqx2hL8U4hiCQz1UoTc7kvcg3FhqL0+k xBluYlrI41r7alrv3ynDUVZHDjw1FEX8XljEn3BWoIKr3upddO38L2AkMUUSUh0Icq6A cAvaw20tiwrH0asgiuJZ/CmqupekuqJjp8CMPcKKIGo8Vfmbi8QD6lF8ZVoWUoHntogS velQpBPHMTnjz7d1O1KF6JJgtyc8+SObMimo0PYOQSn4h9tSpoqreAumx69Y1AWRnpTI u4dH1aGkVJZpUtCe7YIxcZZorofUhaqQdoYi6huhObEORDjP2ervjfAZfJfDzujDXdNm 84kQ== 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=XZHccDbOAkE7y+TRxqxcPVBD1o/5QJCjsx6CvRsqniY=; b=D2kOYXRK/OAucorZzWNTKHMVqOf8rB+pprWqDGjoVJTTJ9kzJ3t1MusaA0wsW5DKsm 4anbfD5PtglWnEA2sfgrbKsiYuyquKx9RR/+OcQtBkn0VjbLrr9l7VZ0dejz5yDsAFqc 4dtSV18/oTOaPxnZNzuYPvuKNcC+elfiqnojMrne9nlxLEeP3YjXdSg7Wy8luP5L2XNL zKMECFxoPSUkNvPYGdmmhol/BIfSRwUroX2Bcf8zyFUEdb4AW2KGjBVKU4xj47MZpBj6 MIrkq/Riwzi17W8McSTyDhl/RvzzxT7k3fGylhP3iIfkQzynwIPglzJo5S1pptqcwK89 mrxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="JiB+I/FF"; 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 m4si15944462jah.87.2021.05.24.08.50.34; Mon, 24 May 2021 08:50:48 -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="JiB+I/FF"; 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 S233971AbhEXPvd (ORCPT + 99 others); Mon, 24 May 2021 11:51:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:33926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234605AbhEXPo0 (ORCPT ); Mon, 24 May 2021 11:44:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 186AD61455; Mon, 24 May 2021 15:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870562; bh=y8tKCc8MNmhJbgdeqlnUMymJi7u75jq1rEAUQ5u/ucY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JiB+I/FFH5Uwu/nQHzG86B2qeDN8GvvCkr42JjF16al5GJOiqI6Ik1sWqsoMNRQ4k XZmbGzDWu+SxQlM8elNpe+H73TtAGHaEq1TPelqV/Vk7mZgkH5B8tvtUksXiBy4ybQ XryXstM4NzMhsFzgeNwxUbSbbdwclXbl0NVukP54= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacek Anaszewski , Phillip Potter Subject: [PATCH 4.19 43/49] leds: lp5523: check return value of lp5xx_read and jump to cleanup code Date: Mon, 24 May 2021 17:25:54 +0200 Message-Id: <20210524152325.760708853@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152324.382084875@linuxfoundation.org> References: <20210524152324.382084875@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 @@ -318,7 +318,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) {