From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (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 856EC21EB88ED for ; Fri, 1 Sep 2017 07:41:53 -0700 (PDT) Received: by mail-wm0-x232.google.com with SMTP id u26so2809205wma.0 for ; Fri, 01 Sep 2017 07:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eM2BlqyOaLAl85xAKKwRwpwJkyrdjWAC1XmfeblYIH0=; b=XJ/HZuk+QXGGtiM2qef0OccXfcVIVU2aUJNdj/GzVcEUHbpYyIE/wcrchyiCHQuZvH 8bDGfsFahRINySIvyRtyfKvAp1+deEnx6MLIusv8gflCQlfsLSZH0k95tnsw4z90VxNN 85gl9eOMgZygA/mTVUOzFIUKBS46dvH97o2pk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=eM2BlqyOaLAl85xAKKwRwpwJkyrdjWAC1XmfeblYIH0=; b=qHJPvejPUNlgtdU2SZMAbxOx6P9jAVZaJBEmiih2FJnsuL84KTZ+MDSvB4VZ9bsmPR +pc+jetAwQClvkscy3nwVKvBEkdKbToAsx3j1E+sCTwZEppAjkq65j9A1kcVzTsgEwvs 1KJYI1WeISF+8yrJC3Pi8LWipVoiJWfURD6YpMqEXcEGiGwSSJxWOhKiWWWBGBeutHhr mpFNifMMpPKEpp5zE6EZuEH4UIJUYhgSLgeZmju4wMIHQoZ6n/nH8Mv9AutGNtVwvQxN 18LBpYWlzx389Pg/VhpxuWL5AwDO5PrONWpbzE4ZgzLn2lu5kHrNEF3HlFr9Fmi6mrRY 6A6g== X-Gm-Message-State: AHPjjUhlFNT74rfHUIc6FRAijy0XTvBVOWPzPTJC4BpAqywHltomz0Gg iO1gNDcShfcvCWuC X-Google-Smtp-Source: ADKCNb6+zyCdXSo2RCC6057R42Qwaq6aEBMsMQ1EyAvXW6zkWl9D/5yaSYRt5fPM3ULMJ2EoWoGrgA== X-Received: by 10.28.148.75 with SMTP id w72mr584824wmd.132.1504277076694; Fri, 01 Sep 2017 07:44:36 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id e8sm423637wmf.37.2017.09.01.07.44.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Sep 2017 07:44:27 -0700 (PDT) Date: Fri, 1 Sep 2017 15:44:24 +0100 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com, jinghua@marvell.com, agraf@suse.de, jsd@semihalf.com, Joe Zhou Message-ID: <20170901144424.mav6qsecvwfwww4d@bivouac.eciton.net> References: <1504271303-1782-1-git-send-email-mw@semihalf.com> <1504271303-1782-4-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1504271303-1782-4-git-send-email-mw@semihalf.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [platforms: PATCH 03/11] Drivers/Spi/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: , X-List-Received-Date: Fri, 01 Sep 2017 14:41:54 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 01, 2017 at 03:08:15PM +0200, Marcin Wojtas wrote: > 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/Drivers/Spi/MvSpiDxe.c > index 0872f61..6ddfcf6 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 = 0; Iterator < SPI_TIMEOUT; Iterator++) { > if (MmioRead32 (SpiRegBase + SPI_INT_CAUSE_REG)) { > - *DataInPtr = MmioRead32 (SpiRegBase + SPI_DATA_IN_REG); > - > if (DataInPtr != NULL) { > + *DataInPtr = MmioRead32 (SpiRegBase + SPI_DATA_IN_REG); > DataInPtr++; > } > if (DataOutPtr != NULL) { > -- > 1.8.3.1 >