Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3316548imu; Sun, 11 Nov 2018 12:13:10 -0800 (PST) X-Google-Smtp-Source: AJdET5dzcjapl4rqyCNFB4vvMBwfha2uFfmssRlVvzCMJDUtbPMpjH/oULirHHHo7MRsb7Dam4kt X-Received: by 2002:a17:902:ba83:: with SMTP id k3-v6mr16686624pls.200.1541967190776; Sun, 11 Nov 2018 12:13:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541967190; cv=none; d=google.com; s=arc-20160816; b=tukBPXIyfz03Fi696C0iaAegyi0JQYDwkgDEkyyruPZ2O3EUjKDO8SJXtxOT392oWa l25oTjt3glJcX8dsiFa5uFagBTXZkFPBfXa3hkB11pGsA8uOvDjTOe37xF0qC8YK9SrG /m2Ljvq3Py0oe3jfWI0MVfxDRvb50APjalE/Moykd+ok3VPRPMiqr0/9AvhvyigkraiQ oDf+LhiIRye3tIB81S98xvy2+YoNXZHazRB+iYFlI5tsWXq9GsCAT/R4y9PG8bug5RtL XMROm98mPNKlbzvEK3NNhgkbHLRwP7W0lQhyCJcmspIdRfR96usUH5mM18yTODbUYud9 QwHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=4uPxSIF2L1phq0T1R38iemHtjqDTYCfyUQaYIDQ8OgI=; b=aHABxV+9ZMEbyEu4HQ7IunhCsl66KmrP6H6Xmn1BHDdR0biWrJ9bpAWl+UUuzzRony Dsa00TfhODQ2/f2wft20kZ49KnwOgUZqh4jzuZ3Zet7Nob2nqRkIdBQHk20WuwtsRsZK YwoAutXzyePqgbbYIQ8lKsAI5UqgN0XQoB00/E4uYHwagahjx8WIOc/uTbi8mg/VQVV6 V/TilnSztUwIQnMzabnIX2Ju2o0gNuB47e84c7JlTlPoNUEoKH54sRP+W95LpMjNLqTG mLu5sEyLvKPLwRIKpfRRE9QpyFn51wdHTC5EUoxczwAbkFqG23vISJhkfZKw3V1isNbo uEcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6-v6si15277466plr.115.2018.11.11.12.12.55; Sun, 11 Nov 2018 12:13:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731240AbeKLGAT (ORCPT + 99 others); Mon, 12 Nov 2018 01:00:19 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:52396 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726471AbeKLGAS (ORCPT ); Mon, 12 Nov 2018 01:00:18 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsv-0000lJ-By; Sun, 11 Nov 2018 19:59:05 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsU-0001eN-SI; Sun, 11 Nov 2018 19:58:38 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Dan Carpenter" , "Vinod Koul" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 208/366] dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit c4c2b7644cc9a41f17a8cc8904efe3f66ae4c7ed upstream. The d->chans[] array has d->dma_requests elements so the > should be >= here. Fixes: 8e6152bc660e ("dmaengine: Add hisilicon k3 DMA engine driver") Signed-off-by: Dan Carpenter Signed-off-by: Vinod Koul Signed-off-by: Ben Hutchings --- drivers/dma/k3dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/dma/k3dma.c +++ b/drivers/dma/k3dma.c @@ -652,7 +652,7 @@ static struct dma_chan *k3_of_dma_simple 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));