Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3080999pxj; Mon, 17 May 2021 17:16:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbR6FKaQvD/pAQTsx2+lqG0pWBtBJmR6aHrZhJTdgILHUrK8Q0BgdPGdksann05hdJ+VR5 X-Received: by 2002:aa7:d7c9:: with SMTP id e9mr1872351eds.357.1621297019769; Mon, 17 May 2021 17:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621297019; cv=none; d=google.com; s=arc-20160816; b=dLXsM8ACh5c7YOBAKo2Ny4opyrbxaA6busgFr4G2xMTh2Cos7rxTrtOx5pnfbugypJ UvUM7peqDP5QRuzIaIOW+uPHdk4PFJ4CsG8Gq/1EpH12h9o85HcErlX5tbuleAQRtw93 a4mbDYbIl3y8y8v4QurTZ7Fps2wP/BMWUB0o5jPRSz7ijpIJebtp709FGM0Td1xHIUSz F+M9Xc2Yl604aRw0ym3xckInpRurGEm1gms6OKHL2+nz/6u+UEfvsUtjvhO3yMEvtyNy Wjt4I4Ty72B6bS3vVXe+4JVMTTzxmGYp74oJAxEDPLPi2+447QDnLOK+nzw6HJVCutjg uxYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=l16/5m8QJIVAe8LjV0E9IMVVaupiK1gm66n/Wr8T/Lo=; b=sqWZ/3b+CjOOjmlXVXJW1iu+C5bCVplPehS/gD9duDEAC6OLkVD6rPo8XkySq6CjNj PS4t7KVDZ2+1SU83dBh8YqgmQ84IUJ+bpBCMmpNHJZ3sVTM6HdAlSfOiDH+v2G3oez0b TLPB++mIhThV5oCqt4+xpIAP/pAC2NhdXSsAFJiHh2OpeEf0CRQZTlhmAYm6aCbD18zQ QGMs01cqb6mw645/VC40t6RTlqd/kBUC6Lze0jSRafuL55Tq0pLt4SSThaTOGV3lXVxu 24Ek9/kajRDd4zdbMiwQ6EVSY51asC2PRQnX4ICMpxyvmBIg3b+2BMX5XjbXCitm7bYt S5Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Py4qOgP2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gt10si14295225ejc.392.2021.05.17.17.16.31; Mon, 17 May 2021 17:16:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Py4qOgP2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239619AbhEQO1D (ORCPT + 99 others); Mon, 17 May 2021 10:27:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:37626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239321AbhEQOXS (ORCPT ); Mon, 17 May 2021 10:23:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2CA4661456; Mon, 17 May 2021 14:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260743; bh=vtm7F/6tXDBNDtMofCJDG2fGHndGHXEprEjcQpcyU6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Py4qOgP2y6VUHtHy/LJQzLWBl05GpV3qFuda1+M5sMJjvZJWM+aDFEStoq6f7dNFq RIZFhlJfAvpJoFRgtvbkU/uO3qoCiaNvvpB+xnf9V6jfP/Iu82x2sPT+LaicJIem2Q O/vFaWACjWs9ZWWhOAdw106EysNIdWiZ285l0cQc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Claire Chang , Konrad Rzeszutek Wilk , Sasha Levin Subject: [PATCH 5.12 185/363] swiotlb: Fix the type of index Date: Mon, 17 May 2021 16:00:51 +0200 Message-Id: <20210517140308.842374980@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Claire Chang [ Upstream commit 95b079d8215b83b37fa59341fda92fcb9392f14a ] Fix the type of index from unsigned int to int since find_slots() might return -1. Fixes: 26a7e094783d ("swiotlb: refactor swiotlb_tbl_map_single") Reviewed-by: Christoph Hellwig Signed-off-by: Claire Chang Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Sasha Levin --- kernel/dma/swiotlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index c10e855a03bc..fe4c01c14ab2 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -608,7 +608,8 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr, enum dma_data_direction dir, unsigned long attrs) { unsigned int offset = swiotlb_align_offset(dev, orig_addr); - unsigned int index, i; + unsigned int i; + int index; phys_addr_t tlb_addr; if (no_iotlb_memory) -- 2.30.2