From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.32038.1585205466748211679 for ; Wed, 25 Mar 2020 23:51:06 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: hao.a.wu@intel.com) IronPort-SDR: A61J5YltvIe3rgRL9K2f13p6BJog5fFlfMowQo5lhxon1lRLlK4ImovJ1DqSkpdZVRW1ev6kvV jGOzcTMulFWg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 23:51:06 -0700 IronPort-SDR: ZFRNDoRBIQjbz/Abwb0pMccztF+mz0UxHme2aYv+vYKJnFxY/DitXwupAzeJuni3Aev4gajvjL ajwF3Ew0kJrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,307,1580803200"; d="scan'208";a="271066609" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 25 Mar 2020 23:51:05 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Mar 2020 23:51:06 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Mar 2020 23:51:05 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.206]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.137]) with mapi id 14.03.0439.000; Thu, 26 Mar 2020 14:51:03 +0800 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Jiang, Guomin" CC: "Wang, Jian J" , "Ni, Ray" Subject: Re: [edk2-devel] [PATCH v3] MdeModulePkg/SdDxe: Check the Token to avoid null pointer Thread-Topic: [edk2-devel] [PATCH v3] MdeModulePkg/SdDxe: Check the Token to avoid null pointer Thread-Index: AQHWAznLAT/lkYsTskqXySUzrMnc1ahab0pw Date: Thu, 26 Mar 2020 06:51:03 +0000 Message-ID: References: <20200326064250.1519-1-guomin.jiang@intel.com> In-Reply-To: <20200326064250.1519-1-guomin.jiang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@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 > Guomin Jiang > Sent: Thursday, March 26, 2020 2:43 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J; Wu, Hao A; Ni, Ray > Subject: [edk2-devel] [PATCH v3] MdeModulePkg/SdDxe: Check the Token to > avoid null pointer >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2286 >=20 > Token pointer may be NULL, it should be checked before use it. Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Guomin Jiang > --- > MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > index 9f42abe7e2..721f264377 100644 > --- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > @@ -1367,7 +1367,14 @@ SdEraseBlocks ( > return Status; >=20 > } >=20 >=20 >=20 > - DEBUG ((EFI_D_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p > with %r\n", Lba, BlockNum, Token->Event, Status)); >=20 > + DEBUG (( >=20 > + DEBUG_INFO, >=20 > + "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p with %r\n", >=20 > + Lba, >=20 > + BlockNum, >=20 > + (Token !=3D NULL) ? Token->Event : NULL, >=20 > + Status >=20 > + )); >=20 >=20 >=20 > return Status; >=20 > } >=20 > -- > 2.25.1.windows.1 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > View/Reply Online (#56363): https://edk2.groups.io/g/devel/message/56363 > Mute This Topic: https://groups.io/mt/72558979/1768737 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.wu@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D