Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp461796pxj; Tue, 18 May 2021 07:16:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjrvcaOUp/OZjWaMvp3S9JFdPTRoXc89i5r4swC3YB0MGfH6H5BG4Kvz5/WJZOly6tpgNu X-Received: by 2002:a17:906:58ca:: with SMTP id e10mr6137698ejs.403.1621347401298; Tue, 18 May 2021 07:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621347401; cv=none; d=google.com; s=arc-20160816; b=bOvxx/jHPhy/zt8Qe/qa4mYrqudOf9I5dNwhtxRoM8YOqijKGCvTyoHVB7bA4iuTa5 gRMbWzGevrbQC8k1Vlyx4a0ExClAIwjAwAHcgaB6QFavK4X3/HvCUsNGvMZExLtI5tgS nOWLi7HFrfFLLwH9e8rEoNH6H8087MRLL7vuTgs5oD2C+dT8w9dGg0RcboolpR+12GBU m1FpO1R/k3EuoWfYuON/5W5Kb7+LSYbwJIyTdOn7vzJcPQKSDwP807p/41MmOGH2sW9m 1xdDPRfxrTLH7j4YKsbwL5G/jfvNZQl/o6D5yLBtrKb9/+ZeDYjlC2N39OMPnXB/6n/a 4XWA== 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=qUnvNSom7CScOyPEKcDi+WkDb35c1us3l1L3rANfI44=; b=BIcDUXq1dyCl4c7+DdNXHVs6GMiDXprGAMv4DCaP9nX4qsxhmm4gdT4dgEoP7aChjo DipFRvwpowiE5ZwIHk/1W1KLWg9TODuhbQo0D51Oaj8OOC6/ZjVOCt5+XlhDOP0PW5Qj vXswRDpxFtvYrywfY7skiDF8g6xzwhMoq9dkea4umuUr/A0NMLJItPhwXDlN790kx1Wk KtDcvZmdzOTwc88DS+lu7h/FqZiktKtZKYx12HP5naZ9Pwnih9wsyT5ulW/MtRLdqgzj dom2qm3AWaUhPCofxBU5GFmIXSChNliZ2PP7pffJQ4gmCLH6WX5L4I88W/uiSEJlMY8z lwiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pwX94mJq; 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 h5si18154545edn.213.2021.05.18.07.16.18; Tue, 18 May 2021 07:16:41 -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=pwX94mJq; 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 S239403AbhEQPoD (ORCPT + 99 others); Mon, 17 May 2021 11:44:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:55194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244781AbhEQP2d (ORCPT ); Mon, 17 May 2021 11:28:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E4EB61CA7; Mon, 17 May 2021 14:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262230; bh=jd+3GClUX9w9h5FCCXNN+Z/QioH6p1cvLXKrfiNlY9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pwX94mJqOgaq7HaqJakN4oNifxVJ+4UggmrK5rwIXOf2DUesJ9AQWM2WRKnwfgHX1 Ir6CIKYJhLry8kD4W75XGm9xJAXfzBQdyHOKpNLXc90SkKV2z0EwqagJ4sXO1s3C5f W+hJdEEQiqze9M+ARbpnjtZnhO5AN0sUw+lSeNW8= 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.10 138/289] swiotlb: Fix the type of index Date: Mon, 17 May 2021 16:01:03 +0200 Message-Id: <20210517140309.801673846@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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 ba4055a192e4..0f61b14b0099 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -563,7 +563,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