From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933573AbcI3RxR (ORCPT ); Fri, 30 Sep 2016 13:53:17 -0400 Received: from mga01.intel.com ([192.55.52.88]:48604 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932430AbcI3RxK (ORCPT ); Fri, 30 Sep 2016 13:53:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,273,1473145200"; d="scan'208";a="1048018934" Date: Fri, 30 Sep 2016 23:31:45 +0530 From: Vinod Koul To: Vincent =?iso-8859-1?Q?Stehl=E9?= Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Zhangfei Gao , stable@vger.kernel.org Subject: Re: [PATCH] dmaengine: k3dma: fix off by one Message-ID: <20160930180145.GB2467@localhost> References: <20160921201655.19674-1-vincent.stehle@laposte.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160921201655.19674-1-vincent.stehle@laposte.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 21, 2016 at 10:16:55PM +0200, Vincent Stehlé wrote: > In k3_of_dma_simple_xlate(), the d->chans[] array has d->dma_requests > elements so > should be >=. > > Fixes: 8e6152bc660e69f5 ("dmaengine: Add hisilicon k3 DMA engine driver") > Signed-off-by: Vincent Stehlé > Cc: Zhangfei Gao > Cc: Vinod Koul > Cc: stable@vger.kernel.org Is it really stable material? Yes it fixes a bug, but how many will notice this? > --- > drivers/dma/k3dma.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c > index aabcb79..cd7f67b 100644 > --- a/drivers/dma/k3dma.c > +++ b/drivers/dma/k3dma.c > @@ -792,7 +792,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec, > struct k3_dma_dev *d = ofdma->of_dma_data; > unsigned int request = dma_spec->args[0]; > > - if (request > d->dma_requests) > + if (request >= d->dma_requests) > return NULL; > > return dma_get_slave_channel(&(d->chans[request].vc.chan)); > -- > 2.9.3 > -- ~Vinod