Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3344240pxv; Sun, 4 Jul 2021 16:06:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4RA/i4OpBsbvIdyLH8kT61BnF2+pBbRXBB1XHIPxpBrlDGf59hmCE00QWz97AoWQv6zRb X-Received: by 2002:a05:6638:618:: with SMTP id g24mr9825841jar.16.1625440018335; Sun, 04 Jul 2021 16:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625440018; cv=none; d=google.com; s=arc-20160816; b=Wcf8dMgVp3nuB9Iexg8r3vuqrlz+L/MHIUJaAFHVoVpULGdP2eJUo8TSb1N4oYqoCK YQBtKY9ki6qC6QXWuQsAUT0jhgkeTenGt93GpOgTNoiM/022xLCB8n8EB6dRnkh2pOpX O/NTEpDnnCBveOoHObIJuAIQolU9Q1HUCarV3dxsdiikEnr9lD6UwNCtTo4Y2GIPObU2 dhs85XMSrCiyZY3GrPW4BMAM0LpHNsxHKMQV+pxYU6qfHguXe5JjvfLmklX0U4xt0/tP lDT63onwXNGbC/QaTMRgdA88fsMEMDgtQs6ywCaezqu/K00j6AlZF11AvP9NVqsn1wgg uaiQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hIaiNwijnr7l2lQH1yGNI3HR3Cn20s7ayUysQB8V+Bw=; b=MCRJ0lvruxeCPZUtGBmUh2YuDJ8bW04FoDMktXY/dbvwCjwWS1MO7QdrgVtdR8VY2L N41xgSSDntzXR2vzGpQopyVddfFbaCG7Xtqr64xy0AqwU2m54NbCDDZ2IWCt/1UNQH7O xdahIZjqUzEONnbQOYVFeA4IKYC3r38O/QlZ6H1vOdQfmVLbOlDod/C7B561Aym93pYe 0ygjablw2FjJ3ja3tv7juxdVN359bypN3Vo1YVvbo9XT7s8HFfZb/UrFaRgNxW2rMb3J PJ8EsF/6NDwLQ9dgZSh1nc58hgUYkbWqypYJ8NXi5NxPCxsdtCx8ImpAKqZlGmEBUKWY Oyzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kffJuk60; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si13218826jac.95.2021.07.04.16.06.46; Sun, 04 Jul 2021 16:06:58 -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=@kernel.org header.s=k20201202 header.b=kffJuk60; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230207AbhGDXHd (ORCPT + 99 others); Sun, 4 Jul 2021 19:07:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:45464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbhGDXHU (ORCPT ); Sun, 4 Jul 2021 19:07:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A782611ED; Sun, 4 Jul 2021 23:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625439885; bh=56Oq7wqAYVvLyK3t7Eltf5zrlTCVibdj8RYSjRLBd5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kffJuk60K0QwQuH+H4dOtfKAl02Kuad3yxJxdyHaKpWBmeiFyijQgW0PT+TSwleMM PNocowqUtpdaTGj2q6JouuhZR+w4z+I0oev+E/zShXmYa4G4qCWlkbmIaN2jkteCCu MhswX37akox10imrIOn5V9knm0rSCommJiN2qBEuxmw2LKF/oEGgRiZrPmZSP+9bkC LJlvmAD6ChvlCl17KO9F3S3mFSigH0ruUV1eATRYrHkpKORk2FtphxBeMS7EsGK42p 55dtRrO1ahKp8ouJ1BZFtGSvJ9xiguq3XvAoyMpK3FB32BrqKhW5Riytg7RhZuhFDW VFp47FSu3KLbA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tian Tao , Mark Brown , Sasha Levin , linux-spi@vger.kernel.org Subject: [PATCH AUTOSEL 5.13 18/85] spi: omap-100k: Fix the length judgment problem Date: Sun, 4 Jul 2021 19:03:13 -0400 Message-Id: <20210704230420.1488358-18-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210704230420.1488358-1-sashal@kernel.org> References: <20210704230420.1488358-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tian Tao [ Upstream commit e7a1a3abea373e41ba7dfe0fbc93cb79b6a3a529 ] word_len should be checked in the omap1_spi100k_setup_transfer function to see if it exceeds 32. Signed-off-by: Tian Tao Link: https://lore.kernel.org/r/1619695248-39045-1-git-send-email-tiantao6@hisilicon.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-omap-100k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c index 7062f2902253..f104470605b3 100644 --- a/drivers/spi/spi-omap-100k.c +++ b/drivers/spi/spi-omap-100k.c @@ -241,7 +241,7 @@ static int omap1_spi100k_setup_transfer(struct spi_device *spi, else word_len = spi->bits_per_word; - if (spi->bits_per_word > 32) + if (word_len > 32) return -EINVAL; cs->word_len = word_len; -- 2.30.2