From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mx.groups.io with SMTP id smtpd.web09.10982.1637673016930128842 for ; Tue, 23 Nov 2021 05:10:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20210112.gappssmtp.com header.s=20210112 header.b=wLWV6/uq; spf=pass (domain: nuviainc.com, ip: 209.85.216.43, mailfrom: rebecca@nuviainc.com) Received: by mail-pj1-f43.google.com with SMTP id gf14-20020a17090ac7ce00b001a7a2a0b5c3so2048350pjb.5 for ; Tue, 23 Nov 2021 05:10:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20210112.gappssmtp.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=haA4YiBBLfF5Va0Dnv1H6dB+RNXa6E1WKmIYgXWeGtw=; b=wLWV6/uqbeMNOx0NOKkk8o4JTvmu/uX/mzSuswT7xfYFdbQDJb9qKpfy1ciatINfbl sDGYLYx9CHxgWxYJVyXpNNN7dsUEm0Z088bL/dGGmVFnrGtsG39YKwFh7XuzIvKiypTa Oe3LvID4RzQtjrBVKZFuYFGcVkpAvQIpHLXNBaz/CrQwlFxs9G7jVfFd5Liwn3gyPZFD abm7hN3AlonBnwa72UwmBU09HLUg3ZT3txm5FegpYGeAUJxgeEnN4w5hmmengT7bPh75 fl8hMN3D0vNbZAhdL8yrMkjfPRYZrChaRIngBrMV1hW51+GXL8Zf4mNGqSua3urW3Ffo S5gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=haA4YiBBLfF5Va0Dnv1H6dB+RNXa6E1WKmIYgXWeGtw=; b=zTMTkbmavbe4d/GZfkXzAgvwBXaDV4kXnRg7AQYtkzH2GhE+ASaM3QBKOGHmlwJbII M53GKPsedNSpdwQPvHYEnGlIascU0fWHCN1Mf9i2CUv2rQ50QjLmFiYZW8hRGss4hdSB /X1WvZqm1n7Tjo9oRY6QMgvLNkwM4VAr/BsE31iM48sVZ4Uq0LIwB1R3t8z2vghuWZ0s EDFhbRpZNcTLJu94f7ZdQ7kNP/PLaqaFbiPUyWv/XKYEsOvR2Z8Q65lM9Ga0OOv8IYpa N3k/QZgLve0/f3P9V6H1NtTHdpUWn2bGzO8PFxXu3l2LPuFe/2TduodYP09+CcRSwADa zyzQ== X-Gm-Message-State: AOAM532+BXOnnO35OLpQl/Rq/Ui6IgBYDNM5rTSxaYRpw0xc8vYM8zBI 421QKT0qU4dY93YIYXcpCzd8RQ== X-Google-Smtp-Source: ABdhPJxpXdd5iulZNm5vi/AVJi/VHXGOhn3NigkaHJ9cIypZDyBJbRL1/XldZmrVqOHsEVpjsWIo0Q== X-Received: by 2002:a17:90a:a396:: with SMTP id x22mr2792331pjp.14.1637673016484; Tue, 23 Nov 2021 05:10:16 -0800 (PST) Return-Path: Received: from ?IPv6:2601:681:4300:69e:9e7b:efff:fe2b:884c? ([2601:681:4300:69e:9e7b:efff:fe2b:884c]) by smtp.gmail.com with ESMTPSA id s19sm8801285pfu.104.2021.11.23.05.10.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Nov 2021 05:10:16 -0800 (PST) Subject: Re: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access To: devel@edk2.groups.io, gaoliming@byosoft.com.cn Cc: Hao A Wu , Ray Ni , Leif Lindholm References: <20211116025328.1604-1-gaoliming@byosoft.com.cn> From: "Rebecca Cran" Message-ID: <680de582-f33a-edd3-afbc-f9aafd05595d@nuviainc.com> Date: Tue, 23 Nov 2021 06:10:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211116025328.1604-1-gaoliming@byosoft.com.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Acked-by: Rebecca Cran I've confirmed that this patch fixes the exception I was seeing when running the DEBUG build of SbsaQemu. -- Rebecca Cran On 11/15/21 7:53 PM, gaoliming wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3732 > Recent change c974257821208fc6191779d1ddea918499f165b8 exposes this potential issue. > > Signed-off-by: Liming Gao > Cc: Hao A Wu > Cc: Ray Ni > --- > MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > index 7626bac38d..bda900a161 100644 > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > @@ -885,6 +885,13 @@ AhciPrintStatusBlock ( > IN UINT32 DebugLevel > ) > { > + // > + // Skip NULL pointer > + // > + if (AtaStatusBlock == NULL) { > + return; > + } > + > // > // Only print status and error since we have all of the rest printed as > // a part of command block print.