From nobody Tue Nov 26 06:35:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56363+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56363+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1585204974; cv=none; d=zohomail.com; s=zohoarc; b=F2Rkx4UWEpxsixf3JULVBkhUPH16NNb16wkYNfEMj+37fN0OFy2QC42fCNyoPGVBajTuELvlYAY5NOwWTCwghebRyjNcJFzIqR1mUENJw9tt0t+wlPXCMLtHsfJOnAM7G4NI2MF3sWo3vLHxvVtJxzAtt7T4KviO/2w5DF1IRqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585204974; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=LVX5AwI92wo6iLgukHs4/9ru3cbea6JzDeQFPWs2ptI=; b=A8lJl4J4/vl5V9ntdAYhfgWtTVVJ5RRXLuzSjqf8vwqQ2l7mspSPfUOFIkSAAX3FcD5O28/IHhxKWUKBP9r8QOgd0lKUBOjmr2fj3xC/vWWpGQRJQT0wWTSmxTGnniorvacrClakDep1XZlXAY7ZETk9i59+o8Y40FRV7NSL74c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56363+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585204974247849.6492887920446; Wed, 25 Mar 2020 23:42:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fqdyYY1788612xrqC9ITvKSy; Wed, 25 Mar 2020 23:42:53 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.31961.1585204973316712239 for ; Wed, 25 Mar 2020 23:42:53 -0700 IronPort-SDR: TCAK8hscA3wsfCTOWdVhlvlsT5QXmVrwzV6/hZPKR4CoxNoZ2hhcCMPn+CMPMSG6I79zjaD0BJ 24gY3OhFpmAA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 23:42:52 -0700 IronPort-SDR: Ll6r1VAOBBgqcOH9SYMRCSARa3dNu6AfWaIcskqKJPAKoH6QEdu3utZFHPQmnBdUYe1x1qyNYT zcBtwDshdIZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,307,1580803200"; d="scan'208";a="420585729" X-Received: from guominji-mobl.ccr.corp.intel.com ([10.238.5.173]) by orsmga005.jf.intel.com with ESMTP; 25 Mar 2020 23:42:51 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH v3] MdeModulePkg/SdDxe: Check the Token to avoid null pointer Date: Thu, 26 Mar 2020 14:42:50 +0800 Message-Id: <20200326064250.1519-1-guomin.jiang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,guomin.jiang@intel.com X-Gm-Message-State: lDW4RAU96aZ5AHHyVUHMXOOKx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1585204973; bh=BfQnGiyyKyydFJZvOq6FtzHsvWxRa0gGgMyd/DEie2k=; h=Cc:Date:From:Reply-To:Subject:To; b=IyizsKIZlexijANhbgooFnW7Kqt0oETlwheAZQtwWzXuywtslIWhMBMcvCJwI0bEfdk chU7n0YadbA6eL2s0Q8SKsDKs2YFw/7yydeSdAezh+8/KSksNA+ast3Kpgd67pLwXu7di SOfQC3As9PR8zakq7223MCQmLkzn2JxsmXQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2286 Token pointer may be NULL, it should be checked before use it. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Guomin Jiang Reviewed-by: Hao A Wu --- MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c b/MdeModulePkg/Bus/Sd/Sd= Dxe/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 - DEBUG ((EFI_D_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p with= %r\n", Lba, BlockNum, Token->Event, Status)); + DEBUG (( + DEBUG_INFO, + "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p with %r\n", + Lba, + BlockNum, + (Token !=3D NULL) ? Token->Event : NULL, + Status + )); =20 return Status; } --=20 2.25.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56363): https://edk2.groups.io/g/devel/message/56363 Mute This Topic: https://groups.io/mt/72558979/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-