From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C89E35A3A9 for ; Tue, 14 Jul 2026 07:48:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784015307; cv=none; b=ILmMNGsnTMLVq805K+85XVHf0RFtuGTE47h47Dq1N6/zIQlz3IYqaP8p98gRXZlQEI77xBNH5v/xcCJzhy9XjEO9Ubz2rwmHPBgqpDcIBnXizikEmiXOLEylR3NIfTDdRtMUvjZZNX/dJ4Zjgo6lcfsLYU6H74lh3qnZin9+QHU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784015307; c=relaxed/simple; bh=UzIpQvdgLlLmdEHkcbM8fn3Gj6yOw8Amrfp5HGyfXNE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FxeDXZI9IjW9nmbj5CTbtX/m/DibPOGBfvVj4Wqdg/eb/YuA06Murx+Y989aH1GStkhkHKcn6K2uiQOs8s/7tFLFVmBV68OqtAu38h69XzmdfyxGo5FZy7DbyffX2R9sWf84ZGdySWmVJBf72Q0QGx7IFKAIICxR4b++IjnVDoE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=puMJ1FFK; arc=none smtp.client-ip=209.85.160.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="puMJ1FFK" Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-451fd21113cso670191fac.1 for ; Tue, 14 Jul 2026 00:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784015305; x=1784620105; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=EnDWZQFCaqFrKcYRbfLF0I0CeGWYxEfSRV+U8/QwLQE=; b=puMJ1FFKE0bXil0ccIRkMD5YMX24uu3p0j92CP3sYc9NB2Aj2pePKlYCOt9tWqqoum kDe0V6WZRNyZG9r2k2R6CDumU0wOfodwPs+9OZ8LtwnBZrdrmzD5yERaJuOB3vuI4piR AJ4vjVoNoXVF5UGQ3xHkpOrbALydbpXD2nd/2XmYcAp0kha+tMXq8Mrad6HFqG5PYR2l elaLR1tcDFWdzOUbNTrrqFy3Y5zx1GT34DYmsJG249LioteucEzUSWt4jLuf4ckMIZ10 U3TowfhiWz7KJJix3GLrg4/5uVmq8RSsDhwLHfXgCyl7hSREo6wrG79BIoC3/Gai3IW1 wnJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784015305; x=1784620105; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=EnDWZQFCaqFrKcYRbfLF0I0CeGWYxEfSRV+U8/QwLQE=; b=Xqvkg0AW2UuMhxbFwW0OdG9msDb7kGvTGG+oSQgMQXAHmNFcUtP9eF0QzJgftmir6f zh8FcBDhyUO+EGeTdoUNNzJnVMNsddM2om7HMXBwO//+y5qF+YP+qOZCOqhTllCASy0o BULbjcPdtsw9ulbTB+r3SPP5117o3XkkmkOFfoRT6Hd730RezTNo3THeyKEd73FLEvli 1hW3odIjHt6ha3xzcJRbc6LMwqLnlDKxkV8V9QOLSxOklOBXZbT3WJfs2VSMoUs6onIl OAK7Zt8okEg1IJ4tjdofwh7CRwkiKmTosOrGwXFKAZcqy5UrKeios/6KrgpRPCb7yRYm dc+Q== X-Forwarded-Encrypted: i=1; AFNElJ9rSeS4voc7cFTdVw31QKtZn/96yyJ7q8Yzw0yfYMaBwR/rRTPYLQzdWBWlJAiy+/8XtiLf7ORUcn3iPUg=@vger.kernel.org X-Gm-Message-State: AOJu0Yw67IYfKRiEB+LNq1aYJGsm0fPJ04RdzNcugv7miIit9+W/ov48 Asj8zDm6F8GGAgMkrwUjWvQ50Yxtgz22jk8zeVwtwvY1KUTKVV5Ii3eV X-Gm-Gg: AfdE7cnDrE5xZUgKfD6ERkoDZsfD8KPnjbhHxCNAB6SxC/htTf8P3CYjRFesjm9DWW/ be5Amah3dDEuFE8Z1PSBUhyON0o0u5QxaWzh6tDnbPkY4+H79fadRHT7LdblmBueAge9FGtTO9M denT3qs1xKtOo9kvMp0I0WytoK9qSGaQtVuLp03GNbHcKoEzkAnMvpXIXREmXqg48D9ByVVY58q TvAIoZn6QJLuJDHs5pGuw1WAPLI2MFBBHNMHXOyBUU0VvhkJRBmd1bXXUccGJgwbdkkP7JmdmJ8 jJ3wZhm4t8CEk0Exew5H7/lg/+Mql8OZzOGYGSSsK1nmOIBKcDRM6tFjG7aEYsndDCg5+Ogniev SlaBWak0a2gwF111mW91CM47NcDDY5lHECI+0s+LtY9nrUzF0gmQVhRtBes6pUXI0x0VPNArDUE hN4CU7nwHBW7Qv+r4= X-Received: by 2002:a05:6871:5386:b0:43b:891d:7c89 with SMTP id 586e51a60fabf-451f279c84cmr6166807fac.11.1784015305044; Tue, 14 Jul 2026 00:48:25 -0700 (PDT) Received: from localhost ([74.80.182.78]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4560a9b178fsm870394fac.5.2026.07.14.00.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 00:48:23 -0700 (PDT) Date: Tue, 14 Jul 2026 10:48:16 +0300 From: Dan Carpenter To: "Taedcke, Christian" Cc: christian.taedcke@weidmueller.com, Vinod Koul , Frank Li , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v3] dmaengine: nbpfaxi: Fix setting channel irqs in probe() Message-ID: References: <20260703-upstreaming-nbpfaxi-v1-v3-1-24f7f9aa102f@weidmueller.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jul 14, 2026 at 09:44:22AM +0200, Taedcke, Christian wrote: > > > On 7/9/2026 12:38 PM, Dan Carpenter wrote: > > On Fri, Jul 03, 2026 at 09:56:12AM +0200, Christian Taedcke via B4 Relay wrote: > >> From: Christian Taedcke > >> > >> When one irq is used for errors and each channel gets a dedicated irq, > >> the total number of irqs is num_channels + 1. If the error irq is not > >> the last entry in irqbuf[] but an earlier one, the loop assigning > >> per-channel irqs terminates one iteration too early and the last > >> channel is left without an irq. > >> > >> Iterate over all collected irqs instead of num_channels so the > >> error-irq skip does not shorten the effective channel count. > >> > >> Fixes: 188c6ba1dd92 ("dmaengine: nbpfaxi: Fix memory corruption in probe()") > >> Cc: stable@vger.kernel.org > >> Signed-off-by: Christian Taedcke > >> --- > >> Changes in v3: > >> - Guard against out-of-bound writes to chan in case of an invalid eirq. > >> - Link to v2: https://patch.msgid.link/20260702-upstreaming-nbpfaxi-v1-v2-1-e6d6b178a278@weidmueller.com > >> > >> Changes in v2: > >> - Advance chan only when assigning a real irq to fix out-of-bounds > >> memory access. > >> - Remove now redundant ARRAY_SIZE(irqbuf) check. > >> - Link to v1: https://patch.msgid.link/20260702-upstreaming-nbpfaxi-v1-v1-1-fd8ea8830cea@weidmueller.com > >> > >> To: christian.taedcke-oss@weidmueller.com > >> To: Vinod Koul > >> To: Frank Li > >> To: Dan Carpenter > >> Cc: dmaengine@vger.kernel.org > >> Cc: linux-kernel@vger.kernel.org > >> --- > >> drivers/dma/nbpfaxi.c | 8 ++++---- > >> 1 file changed, 4 insertions(+), 4 deletions(-) > >> > >> diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c > >> index 05d7321629cc..b1f06f0bd0d5 100644 > >> --- a/drivers/dma/nbpfaxi.c > >> +++ b/drivers/dma/nbpfaxi.c > >> @@ -1374,14 +1374,14 @@ static int nbpf_probe(struct platform_device *pdev) > >> if (irqs == num_channels + 1) { > >> struct nbpf_channel *chan; > >> > >> - for (i = 0, chan = nbpf->chan; i < num_channels; > >> - i++, chan++) { > >> + for (i = 0, chan = nbpf->chan; i < irqs; i++) { > >> /* Skip the error IRQ */ > >> if (irqbuf[i] == eirq) > >> - i++; > >> - if (i >= ARRAY_SIZE(irqbuf)) > >> + continue; > >> + if (chan >= nbpf->chan + num_channels) > > > > Prefer my check, but sure... > > Thank you for your review, i send a new version where i try to use your preferred check. > > > > It's pretty annoying that sashiko bot doesn't CC the CC list. > > Is there anything i can do to improve this? Should i reply to the sashiko bot comments and also send this to the CC list? > Not at all. Just random grumbling. regards, dan carpenter