From nobody Thu Dec 26 13:23:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1506303973960462.5485725873385; Sun, 24 Sep 2017 18:46:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BA6B121E43B4C; Sun, 24 Sep 2017 18:42:56 -0700 (PDT) Received: from mail-wr0-x22d.google.com (mail-wr0-x22d.google.com [IPv6:2a00:1450:400c:c0c::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 875A420945B97 for ; Sun, 24 Sep 2017 18:42:55 -0700 (PDT) Received: by mail-wr0-x22d.google.com with SMTP id m18so5213552wrm.2 for ; Sun, 24 Sep 2017 18:46:06 -0700 (PDT) Received: from enkidu.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id f16sm809520lfe.66.2017.09.24.18.46.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Sep 2017 18:46:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:400c:c0c::22d; helo=mail-wr0-x22d.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0MAN6YwS410x5Uda5bJHvW5m5TU3HXk+AGpdMd6Fhkw=; b=zhF1jkYUPmsrNnQhj7GtHHBesqHavj9324IC9FBD51p76H1OZDU+1RCu7MtaFIhJxV kp4rLTYvURlDJHN0VgAmZhHvAIrgnk3LDLZB2aG6XEYgzFTfxYL+LtsbIQK0qRJgRPpN 5Gnwd3BwPKtDbCZrysmCeeNI1saV4LgVQCSiLXt9JPklkjt3gsqG6W/22sCDD2YoOLdm QCORoJNEP2EmuLdFadSqhRDmuJZJqngppXV8EWOf4pVdgA1zz7s6w3oGAim5aLMekq3o A/bTdNoQYop7670LDu0K03Iym5aIZ4On02mXSQUwz1MmdssqcAKOL8yTONb1aPo1jPRf CUBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0MAN6YwS410x5Uda5bJHvW5m5TU3HXk+AGpdMd6Fhkw=; b=E/fD18d93ItoNY2fPTX+qVpDILjyqYCAehoZA8Rr4PMFJN9cs6xKfzfWwPRUHrTkDK 3wBpPBJrkTiWBAup9YrjiAFZCqPVs+jSa+oB+MDR9RbT3MQqDhN68DgDNLCdXc4fP+Pw 3Z3rxM42FJRT5MlD1CG6+ECMtecCTXvNOUu3GxEn7yEI7WMXg3WhUtS8pyqMBPlqoT9R znL9267GuVh20oeSzMUBf/TFg+DgUanPC/VlfqKXCgzgcLByI8qBR9agUEFthFdP79U+ sZQLd3PlIYJLLSQaEopd877lTXnaq3+G7nUFZXE3JcSbI7QTegQcNrRabEOry5Nh5v+n ZoZw== X-Gm-Message-State: AHPjjUjoEi+2F5oYkcDPlCfIsVOGD8aHszQ4S3aEpDH92u059BM/X0db w1G6kTSYcwoHBftNWslOqDAnakwm9R8= X-Google-Smtp-Source: AOwi7QBYenrMY6O4ppM076esXWJUUZM/ingvEAKdZubodEjxLOpeh6Quf5v3QwoE09XBKwl0iWRu/Q== X-Received: by 10.25.129.196 with SMTP id c187mr1727821lfd.107.1506303964736; Sun, 24 Sep 2017 18:46:04 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Mon, 25 Sep 2017 03:51:52 +0200 Message-Id: <1506304319-8620-4-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1506304319-8620-1-git-send-email-mw@semihalf.com> References: <1506304319-8620-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 03/10] Marvell/Drivers: MvSpiDxe: Fix write bug X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, Joe Zhou , ard.biesheuvel@linaro.org, agraf@suse.de, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Joe Zhou This patch prevents possible NULL pointer dereference during SPI transfers. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Joe Zhou Signed-off-by: Marcin Wojtas Reviewed-by: Leif Lindholm --- Platform/Marvell/Drivers/Spi/MvSpiDxe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Platform/Marvell/Drivers/Spi/MvSpiDxe.c b/Platform/Marvell/Dri= vers/Spi/MvSpiDxe.c index 0c6b624..29e1379 100755 --- a/Platform/Marvell/Drivers/Spi/MvSpiDxe.c +++ b/Platform/Marvell/Drivers/Spi/MvSpiDxe.c @@ -226,9 +226,8 @@ MvSpiTransfer ( // Wait for memory ready for (Iterator =3D 0; Iterator < SPI_TIMEOUT; Iterator++) { if (MmioRead32 (SpiRegBase + SPI_INT_CAUSE_REG)) { - *DataInPtr =3D MmioRead32 (SpiRegBase + SPI_DATA_IN_REG); - if (DataInPtr !=3D NULL) { + *DataInPtr =3D MmioRead32 (SpiRegBase + SPI_DATA_IN_REG); DataInPtr++; } if (DataOutPtr !=3D NULL) { --=20 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel