From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46D3E3A6F04 for ; Mon, 27 Apr 2026 16:38:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777307899; cv=none; b=MSvwvj0MLFLwi2hSYlm4pNV5tjqfsPbbKVBm81RNmskYf6DqLd5ks9/+lofeYcrsJ8qLazWdYGYsZEmDMIf3f/yvuoMGpG44lkjLLez0jDpyyfz6I8hu7i+ZMiDEw/ZL4SebBJ/46LOQeagiDbM0lQeBcFljDsBGzInmsxmysZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777307899; c=relaxed/simple; bh=J8q/nVGcKnX6SWJDqDiZOhRFOp3h2skGf01XmpFPBF8=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=OL4QvXjNm5+DZIKHV92Sp65aYXywvuACwDgpDRQDAWwNcEkSgAcjEXKPcpSQTe7WrqfOo6wfsxuvtDdsMkXAQF5JQDlkjoEUvS9q0xd2c/Djyo7Uoejb2JkzszlTc3QzdxkOjLGxcXZb+QAEg3erBkrJe6gtJbGG0X4wUb0Febk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vXkxktWA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="vXkxktWA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94D0DC19425; Mon, 27 Apr 2026 16:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777307898; bh=J8q/nVGcKnX6SWJDqDiZOhRFOp3h2skGf01XmpFPBF8=; h=Subject:To:Cc:From:Date:From; b=vXkxktWAwskuzBW8iNAJlsyFmfFuSg0fD4UqvWGCKWEErgU9jmDEZmLU91uigb+cu Q7JTWB2MjeqiDKVYMoD99ieZJVqLpAdHy6X8YIROEkMNuRZTJCowY6xzZ0Nv8VvB20 Pgxrc8WIPe0HxgLiacFLy6bErIfL/tv7MBHQLACA= Subject: FAILED: patch "[PATCH] leds: qcom-lpg: Check for array overflow when selecting the" failed to apply to 6.1-stable tree To: gregkh@linuxfoundation.org,lee@kernel.org,stable@kernel.org Cc: From: Date: Mon, 27 Apr 2026 10:37:42 -0600 Message-ID: <2026042742-among-oil-412e@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x d45963a93c1495e9f1338fde91d0ebba8fd22474 # git commit -s git send-email --to '' --in-reply-to '2026042742-among-oil-412e@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From d45963a93c1495e9f1338fde91d0ebba8fd22474 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 19 Feb 2026 15:34:35 +0100 Subject: [PATCH] leds: qcom-lpg: Check for array overflow when selecting the high resolution When selecting the high resolution values from the array, FIELD_GET() is used to pull from a 3 bit register, yet the array being indexed has only 5 values in it. Odds are the hardware is sane, but just to be safe, properly check before just overflowing and reading random data and then setting up chip values based on that. Cc: stable Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/2026021934-nearby-playroom-036b@gregkh Signed-off-by: Lee Jones diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c index 016bf468e094..f6061c47f863 100644 --- a/drivers/leds/rgb/leds-qcom-lpg.c +++ b/drivers/leds/rgb/leds-qcom-lpg.c @@ -1273,7 +1273,12 @@ static int lpg_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, return ret; if (chan->subtype == LPG_SUBTYPE_HI_RES_PWM) { - refclk = lpg_clk_rates_hi_res[FIELD_GET(PWM_CLK_SELECT_HI_RES_MASK, val)]; + unsigned int clk_idx = FIELD_GET(PWM_CLK_SELECT_HI_RES_MASK, val); + + if (clk_idx >= ARRAY_SIZE(lpg_clk_rates_hi_res)) + return -EINVAL; + + refclk = lpg_clk_rates_hi_res[clk_idx]; resolution = lpg_pwm_resolution_hi_res[FIELD_GET(PWM_SIZE_HI_RES_MASK, val)]; } else { refclk = lpg_clk_rates[FIELD_GET(PWM_CLK_SELECT_MASK, val)];