From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.8583.1583310033736660620 for ; Wed, 04 Mar 2020 00:20:34 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: shenglei.zhang@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Mar 2020 00:20:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,513,1574150400"; d="scan'208";a="287277435" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 04 Mar 2020 00:20:32 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Mar 2020 00:20:32 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Mar 2020 00:20:32 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.206]) by shsmsx102.ccr.corp.intel.com ([169.254.2.50]) with mapi id 14.03.0439.000; Wed, 4 Mar 2020 16:20:30 +0800 From: "Zhang, Shenglei" To: "devel@edk2.groups.io" , "newexplorerj@gmail.com" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/SdDxe: Potential NULL pointer on Token Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/SdDxe: Potential NULL pointer on Token Thread-Index: AQHV6UCC2cwFPq/YgES1M5yhA1IBqag4J5Iw Date: Wed, 4 Mar 2020 08:20:29 +0000 Message-ID: References: <04882a15a058465196f26220e820e99d90f98473.1582349099.git.newexplorerj@gmail.com> In-Reply-To: <04882a15a058465196f26220e820e99d90f98473.1582349099.git.newexplorerj@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: shenglei.zhang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > GuoMinJ > Sent: Saturday, February 22, 2020 1:25 PM > To: devel@edk2.groups.io > Cc: GuoMinJ > Subject: [edk2-devel] [PATCH] MdeModulePkg/SdDxe: Potential NULL > pointer on Token >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2286 >=20 > Token pointer may be NULL, it is should be check before use it. >=20 > Signed-off-by: GuoMinJ > --- > MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > index 9f42abe7e2..25ab5abb2d 100644 > --- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > @@ -1367,7 +1367,12 @@ SdEraseBlocks ( > return Status; > } >=20 > - DEBUG ((EFI_D_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p > with %r\n", Lba, BlockNum, Token->Event, Status)); > + DEBUG ((DEBUG_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x with %r, > ", Lba, BlockNum, Status)); > + if ((Token !=3D NULL) && (Token->Event !=3D NULL)) { > + DEBUG ((DEBUG_ERROR, "Event pointer is %p\n", Token->Event)); I think a close brace is need here. Thanks, Shenglei > + else { > + DEBUG ((DEBUG_ERROR, "Event is meaningless\n")); > + } >=20 > return Status; > } > -- > 2.17.1 >=20 >=20 >=20