From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web08.5323.1637034502657197507 for ; Mon, 15 Nov 2021 19:48:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=FLt6q9Fi; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: hao.a.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="294435541" X-IronPort-AV: E=Sophos;i="5.87,237,1631602800"; d="scan'208";a="294435541" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 19:48:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,237,1631602800"; d="scan'208";a="671802291" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 15 Nov 2021 19:48:21 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 15 Nov 2021 19:48:21 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 15 Nov 2021 19:48:21 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.44) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 15 Nov 2021 19:48:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VtWq77ZzESQzEWzASDc4Pgo6y4e+rgCd6UNDSPXMwdAgN++fMuszyBFY1y7r4AM08AWg68uPLvz3nBjhCxOoGT5t10VnB+k6LyvhhoLlMexB9yhmHUP5GcZZq98WhiX7oogtpb5SvcISE5Up88VEu/UJN6FIwKd0PbOp+WdWWez7xbtFnDzTEKIuEB/f6ZPJ+MLzviEsNorSPvbl6ef1RrYeSRLCQYm3F0k1UYiEFtvGUvRKBfbT/rPdCYQ2+j4q9+ccUCc3hFn55t6RgY6ZdCGHFXAb89k0VmI5bizAlFKWNgudAcQyhHr+C15r2XHWAZxNEWZqSc9Al1/5jhlM3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H1UFUo8rc99QZNiMm7q9zn6EREQJaMUKAOAI89rrl+I=; b=k/p22w1Rs0e8SDbegZBAQnv/CpapxaZKAog5bnda4tl42SkFV32c8lOBMbVDl4mxhqcN51l6E+hHRIhlADcHWprCJVZVojS3fjVjg8uPJxSQUC6P9hAnuUsbog/IMBnkKtQG5EAu5kZTkpsOFjBW1oWIqDgwfmDwzxzpxRbOAGrGeMgbqJ596CB3zyRtU3SVirVmZWuXtgNkXNNo8OXZCftlKzmuKGWxX3BcqfBjugxMGDEYjDh9qT0pp71ahJcvcZZLErFzr7U31dk7txZSvXBPV8gnYFwtcHKY8LHxu7+5gXnntnl8xG0je7HluW+HffyJYcu6NdLAkexSXQfY7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H1UFUo8rc99QZNiMm7q9zn6EREQJaMUKAOAI89rrl+I=; b=FLt6q9FijUrJwL5TW1yyDFI2Wv/BTNJtLItmZvRtm6QS1KNnICvhGNdBGI7rzWH0g9DUDSmo1kyUk3vm2Egsi+3Au4Csd17qnyEMV6/V988AkOgl6DjS2tKQdsdflmBC6B4wkGwi2tiZ9DDWgM6f70jjIbbNx3DxmgtiKxlIDis= Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by DM4PR11MB5310.namprd11.prod.outlook.com (2603:10b6:5:391::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Tue, 16 Nov 2021 03:48:20 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::14c5:551c:a483:9192]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::14c5:551c:a483:9192%3]) with mapi id 15.20.4690.027; Tue, 16 Nov 2021 03:48:20 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "gaoliming@byosoft.com.cn" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access Thread-Index: AQHX2pUvotv673+UOkOvRV3Ou5PoDawFhEVw Date: Tue, 16 Nov 2021 03:48:19 +0000 Message-ID: References: <20211116025328.1604-1-gaoliming@byosoft.com.cn> In-Reply-To: <20211116025328.1604-1-gaoliming@byosoft.com.cn> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8262956e-95c0-4df5-45ef-08d9a8b3ee5a x-ms-traffictypediagnostic: DM4PR11MB5310: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1013; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +zBHxE9yjV0Wg0vtAPWYSFKy1Rfq38QHY+VpSe8P3ouprHBn/Yv6AfL0PPG0+Im2bPa2SmvkmHn8idFcwlvl/baLpdmUADFe+c5+ee5nSrHhqRN2HKOljuRcbbRqJcMHkihZ9yPy+bV/eb/rf8HJqtkmgZqx49M2C3oHzOZ+ec5dn4CD9EwLpdNtr5FzHQ+q7NG8LH7dO+WWmAkTihsoXi8tdT1MyQsu2dW4i2W7iZAAnzlz894i4MMu/3XxQs8c74oifOoecNjeFFLeNeNamzG0i8LcACzYAOhC/+h88yMIPpRO0Ip37murPYwnLr/DRvkhP1KGn+bJZlfTXMkd/T09JWm9qphg14vYev/di9zzzMx9xyJeP8uVhOVcH97sfp+OYE8OrQQMpT6vzIKaEQGVoz9jxpaIqeHyvgcvMmXbyv1NXmaXWHXqu/05NLLWW6Wi0tQiXf26kPrgjFSWqM1S+CQl68XbEMWP9fb2m15HWgDswtb63LJtcG7Y2HtgMdL86iacVBSC4G6VBDyseiYGL7z/8Eqv+ySluPhGLsF9GeTpYz7PiOMXl/qHCYQJ3EAopVNBcZi9o2AUqyLwRgrYvi9joJXReEUiGWZ+mB/6eugC3aETJylli2XpxN7P0iYUHixk4Sho1LvRV9YDiLnD/0qgs+pvT9K+CaHlbrY0JvTWS9B64wPdhz7aKfEEBR+7HNwYS9VMMDBnPspN4UblkKRq9WSZuP0Fd5TnLO4gSwiRAFxQNrD8vlOE47CVb54XytQUdX0UNqXTr5EfsAjKZkm6QmHjB3c8n4Lpa+z9nF30A2QWmvURdmEvbcKuwvysMbWqbMVQdyWYcrrhZA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(76116006)(7696005)(53546011)(86362001)(2906002)(66446008)(4326008)(38070700005)(9686003)(52536014)(66946007)(82960400001)(966005)(55016002)(122000001)(6506007)(38100700002)(508600001)(8936002)(66556008)(64756008)(83380400001)(8676002)(66476007)(186003)(26005)(107886003)(71200400001)(5660300002)(316002)(110136005)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?x6srC6QSfspDvQoZ5ypL5yZuyyEEeGu4jsQsTgyBiim51761ebkCbpf7H6cz?= =?us-ascii?Q?TT0cSfo1ktQ/AOju3+M0vFDBilZJkmxCdzIX5C3N3Rv/99Oc5Hu2dn6kbcZS?= =?us-ascii?Q?v5Xfrfl+shr4LJBQRzGsdR4hOyhigA2sYzs86xvDfVdfJwTZ0GNIBSnP6fy3?= =?us-ascii?Q?BfqvaOeyNOZhXeLLs7+J9xTjl/QrNP3BRnZC82X2k96d89tJRqZkzN7Nx7SY?= =?us-ascii?Q?jfJEG3c5PFnABgO9uupG3rDzA77qTUUou92fBrcMMtFVVoVeLajn2q8XcG7m?= =?us-ascii?Q?ZxCBeEGHiVYh+j/47WvuVa6J63RpaJNEA/Uo+psQCAModKd8C0pv9bMADhU0?= =?us-ascii?Q?W6f41gUeZqZYSFR0Rw7qVzxlgxFz5CGQN2tT0MMQTfqpTbxVYeZu536wbUmC?= =?us-ascii?Q?86zUf9cTaDRx6yxRqIu1Log4TGf9/QqJ7nI2N5MYvrXRN/d4iSvEoEVGcVL7?= =?us-ascii?Q?jVMWQpef1pBWXMa1TvrVeFyDylz6J0Xz5h+MWYO7IoO5TTat/aK1YnOxu9xG?= =?us-ascii?Q?EybP9+xMlwVnL2NtA31daFiU/PsFdBJAQA5rtdTln3U+bAkLaqn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Q0QVQTEWxyCDNUaTND71aIMZ+Z4EP212O?= =?us-ascii?Q?mFxHy8LQ3meei0A/6vim5uAofdsu4STq8UVhqQ/p1Ti5QMiZlpK/l9lLSBp8?= =?us-ascii?Q?iv1lvLaupZ70YZ1yUQiEp/dNcABczR75/Ppn53j3AOmPJ1KCUfRVGOe5hayT?= =?us-ascii?Q?XCldlOUsCJeRObyK8jLllEQ=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8262956e-95c0-4df5-45ef-08d9a8b3ee5a X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Nov 2021 03:48:20.0012 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DpBM/g2587yJ7bRHQwc2HePdkZR9zI4ixvrP8WtL8blLssdrPcaJQPCcpyDmJ3abe7I3umzg6/hhhFuDDqZHAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5310 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: 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 On Behalf Of > gaoliming > Sent: Tuesday, November 16, 2021 10:53 AM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Ni, Ray > Subject: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the > potential NULL pointer access >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3732 > Recent change c974257821208fc6191779d1ddea918499f165b8 exposes this > potential issue. Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > Signed-off-by: Liming Gao > Cc: Hao A Wu > Cc: Ray Ni > --- > MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > 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 =3D=3D NULL) { > + return; > + } > + > // > // Only print status and error since we have all of the rest printed a= s > // a part of command block print. > -- > 2.27.0.windows.1 >=20 >=20 >=20 >=20 >=20 >=20