From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EE03C3F2D2 for ; Fri, 28 Feb 2020 16:45:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 343B724699 for ; Fri, 28 Feb 2020 16:45:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iJrIjG+I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 343B724699 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A76DC6F480; Fri, 28 Feb 2020 16:45:57 +0000 (UTC) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id D3E6A6F480 for ; Fri, 28 Feb 2020 16:45:56 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id x7so3736977wrr.0 for ; Fri, 28 Feb 2020 08:45:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dnB3YbRslroktKcVWBmtkOUB1kEjE4Aqzh9tCjoW9sA=; b=iJrIjG+IiWYGIuv4aS0pjFrtNOSHON/kkOz+fiN9gPNqV/5tmaqI5quNYhYtXpecqj h0lPxpt0G2l3YPQbieYSSvsK9K1gO4106/0u8OWo7DnozluA3vQdUjQ7TMiPNXIbXNBF iTpUnf84x/8gy3ffZuQouprp9+Aa16QxOw013HNiv2Zr2ZTU0WKzVuFvxSZsDw9qO1y8 xDkWfOJbsUAe51FkbTGW4vTOwIubvGsJlqATWH9CkYAyBK55vv7ZwHj5hwgWdd2WGvwG Ubm3hqu/llx165YndZ4ECuFC8ejjAW0G3p9AbLSNA4r51+wOvxBKRkmnrwIUTYAyqbAY gGGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dnB3YbRslroktKcVWBmtkOUB1kEjE4Aqzh9tCjoW9sA=; b=ojYzIxXF+AgDQygiejucW85nmFdLADniGBfoltTeHZU19vQDgsWCqxJlezT/ZS8ql1 mrhW+gk7qgShTk9NOuZhxM+xn4LD2J1kobfRGplCVNZBCUt2HYCImBooS3RFjNY7YcCH ZOETWoEQlVR596eTRrP5X5zP1w3nRwvSW2HtllxPMFvXyKyK2oFUzEAvh8VhNVZ/Uwf8 N85YRuKfLTdFXxp1dMV++PYveIsBG7fkSBy0BlmUAZ8n8bIvr7XEzuRLDOhCXKaf/Xoh 670Pq0tohRfYYzTQVQu2azILmhtKfX1IE2TnAYgCncivoE1+a5LQed8OQqIe4hWsRqq0 twJA== X-Gm-Message-State: APjAAAW6/7Lqenatg0EHPsbo6yv0i32sg+VVYqrlEvakdS4zFdondE0d /MZiEIV7kiSPFSznpDtXf8UMzA== X-Google-Smtp-Source: APXvYqxeVMWKAvVvcMF6nm972He/fdlmMo/3+VBeCasLPa2AoHRCa64fawVhVSsW5qeL9ISZwA3mwQ== X-Received: by 2002:adf:cd88:: with SMTP id q8mr5442082wrj.286.1582908355553; Fri, 28 Feb 2020 08:45:55 -0800 (PST) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id j5sm13406763wrw.24.2020.02.28.08.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2020 08:45:54 -0800 (PST) Date: Fri, 28 Feb 2020 16:45:53 +0000 From: Daniel Thompson To: Colin Ian King Subject: Re: [PATCH][V2] backlight: sky81452: insure while loop does not allow negative array indexing Message-ID: <20200228164553.eojh3hbrymq3tw2d@holly.lan> References: <20200226195826.6567-1-colin.king@canonical.com> <20200227114623.vaevrdwiduxa2mqs@holly.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , kernel-janitors@vger.kernel.org, Jingoo Han , Bryan Wu , Gyungoh Yoo , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Lee Jones Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Feb 27, 2020 at 03:10:43PM +0000, Colin Ian King wrote: > On 27/02/2020 11:46, Daniel Thompson wrote: > > On Wed, Feb 26, 2020 at 07:58:26PM +0000, Colin King wrote: > >> From: Colin Ian King > >> > >> In the unlikely event that num_entry is zero, the while loop > >> pre-decrements num_entry to cause negative array indexing into the > >> array sources. Fix this by iterating only if num_entry >= 0. > >> > >> Addresses-Coverity: ("Out-of-bounds read") > >> Fixes: f705806c9f35 ("backlight: Add support Skyworks SKY81452 backlight driver") > >> Signed-off-by: Colin Ian King > >> --- > >> > >> V2: fix typo in commit subject line > > > > Isn't the correct spelling "ensure"? > > It is. V1 is correct after all. Doh. It wasn't spelt "ensure" in v1... Daniel. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel