From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mx.groups.io with SMTP id smtpd.web11.27842.1647272340092751863 for ; Mon, 14 Mar 2022 08:39:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=UhTWSNIw; spf=none, err=SPF record not found (domain: semihalf.com, ip: 209.85.167.46, mailfrom: mw@semihalf.com) Received: by mail-lf1-f46.google.com with SMTP id n19so27847109lfh.8 for ; Mon, 14 Mar 2022 08:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Nv6TFBp4IECOs7ZdHZNOA2TjMZEQV/qSiajbT/QBnG8=; b=UhTWSNIwDoHzAbNh8UDmjZxZD48rGEPQ1W4T5joP20NVvNLYCw4bIs4lHWjlgV5Lxt nL+0nkoX7EMIX+ZDE9VL7ccbeJTjUhT5N6xqiZ81wP6nhHqPH8HbrkJrEyZzOG2TDwUg QJ8KDDSEXBowQJIqu2Ie/eZtSJmjFiZz1DObUZnzkRhDFlBtrB21UwLEMi3BU9glIrQZ xY2AJjX0GyWJffpx7KnpxrvnTC1ZkJX5nwFMt6dXn7OBZURlDj30avnHtD4nT5bdu/1s +fHGzIOM9s6hXoaOMOqgU/RaTGQ/DSqRLpX67XxCVY6iGNyeY0EyYH0/LUbiKnbPXrui Qztw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Nv6TFBp4IECOs7ZdHZNOA2TjMZEQV/qSiajbT/QBnG8=; b=4dyXcXJnT3g7AjPpao2fL9R6unnzj0PDseezt/kKi13sYRDqU2+s0JVos0VVvJ/UJL V4oDC3a6fFbugKnVvdRumBCPNxIMi4vTB5/+1U4pRm3WqwHaS8D1ilOtWja4qtVr2TUD TKnL6F7JRojxaI6aUfc2dSRK+3FkhOY+HrJwnw9D/7P9RkaKpvMvyCOtne/dHZMz+9wX IW9g5TtHhFJSWWuiCjW97U77GSHTBJKrlGymq1nm8rf8estw3LctEJoebmySmGhMeBUa SY4L7wnunYHfmDvJJ2Wl+kPIHYgPO/4N0e3lKVBDjzMgK54FW5GzRetUhRjKFIzT+fol uSHQ== X-Gm-Message-State: AOAM533wRTsgRtAD21Wb3nXuIxyW+Qu9h+z5sTSGON+/gEY4WEq2JZOf n9hthU0Yb70W9rNKybplEVinQWaIBrWtxg== X-Google-Smtp-Source: ABdhPJz+L6q7IfA5Z5SKs7v4PeZ6GU3iB3Lh3fXfIvgRvbB7jvy/LK2dR9u4JizC9uhdjXlMENBgUw== X-Received: by 2002:a05:6512:a81:b0:445:c06b:a531 with SMTP id m1-20020a0565120a8100b00445c06ba531mr14090939lfu.364.1647272338339; Mon, 14 Mar 2022 08:38:58 -0700 (PDT) Return-Path: Received: from gilgamesh.lab.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id b8-20020ac25628000000b004484bd1be5esm3325401lff.256.2022.03.14.08.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 08:38:58 -0700 (PDT) From: "Marcin Wojtas" To: devel@edk2.groups.io Cc: quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, mw@semihalf.com, jaz@semihalf.com, gjb@semihalf.com, upstream@semihalf.com, sunny.Wang@arm.com Subject: [edk2-platforms PATCH 7/8] Marvell/Drivers: Pp2Dxe: Fix Pp2SnpReset Date: Mon, 14 Mar 2022 16:38:36 +0100 Message-Id: <20220314153837.1885852-8-mw@semihalf.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220314153837.1885852-1-mw@semihalf.com> References: <20220314153837.1885852-1-mw@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This patch adds missing parameter's and SNP instance status checks. igned-off-by: Marcin Wojtas --- Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c b/Silicon/Marvell/= Drivers/Net/Pp2Dxe/Pp2Dxe.c index deb3f34625..841a1c8f84 100644 --- a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c +++ b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c @@ -647,6 +647,33 @@ Pp2SnpReset ( IN BOOLEAN ExtendedVerification=0D )=0D {=0D + PP2DXE_CONTEXT *Pp2Context;=0D +=0D + /* Check This Instance. */=0D + if (This =3D=3D NULL) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Pp2Context =3D INSTANCE_FROM_SNP (This);=0D +=0D + /* Check that driver was started and initialized. */=0D + if (This->Mode->State !=3D EfiSimpleNetworkInitialized) {=0D + switch (This->Mode->State) {=0D + case EfiSimpleNetworkStopped:=0D + DEBUG ((DEBUG_WARN, "Pp2Dxe%d: not started\n", Pp2Context->Instance)= );=0D + return EFI_NOT_STARTED;=0D + case EfiSimpleNetworkStarted:=0D + DEBUG ((DEBUG_WARN, "Pp2Dxe%d: not initialized\n", Pp2Context->Insta= nce));=0D + return EFI_DEVICE_ERROR;=0D + default:=0D + DEBUG ((DEBUG_WARN,=0D + "Pp2Dxe%d: wrong state: %u\n",=0D + Pp2Context->Instance,=0D + This->Mode->State));=0D + return EFI_DEVICE_ERROR;=0D + }=0D + }=0D +=0D return EFI_SUCCESS;=0D }=0D =0D --=20 2.29.0