public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zhang, Lubo" <lubo.zhang@intel.com>
To: "Wu, Jiaxin" <jiaxin.wu@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Ye, Ting" <ting.ye@intel.com>,
	"Fu, Siyuan" <siyuan.fu@intel.com>,
	"Wu, Jiaxin" <jiaxin.wu@intel.com>
Subject: Re: [Patch] NetworkPkg/IScsiDxe: Fix the incorrect error handling in DriverEntryPoint
Date: Wed, 22 Mar 2017 03:03:12 +0000	[thread overview]
Message-ID: <7619447B08B8F74DA4FF2A813B79803B39B050EA@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1490146392-2804-1-git-send-email-jiaxin.wu@intel.com>

Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiaxin
> Wu
> Sent: Wednesday, March 22, 2017 9:33 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting.ye@intel.com>; Zhang, Lubo <lubo.zhang@intel.com>; Fu,
> Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [edk2] [Patch] NetworkPkg/IScsiDxe: Fix the incorrect error handling in
> DriverEntryPoint
> 
> Currently, error handling in IScsiDriverEntryPoint is incorrect. For example, if
> IScsiCreateAttempts() return error due to the limited max variable size, iSCSI will
> not unload the configuration entries.
> 
> Cc: Zhang Lubo <lubo.zhang@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
>  NetworkPkg/IScsiDxe/IScsiDriver.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c
> b/NetworkPkg/IScsiDxe/IScsiDriver.c
> index 269c1ae..2249919 100644
> --- a/NetworkPkg/IScsiDxe/IScsiDriver.c
> +++ b/NetworkPkg/IScsiDxe/IScsiDriver.c
> @@ -1811,11 +1811,11 @@ IScsiDriverEntryPoint (
>    //
>    // Create Keywords for all the Attempts.
>    //
>    Status = IScsiCreateKeywords (PcdGet8 (PcdMaxIScsiAttemptNumber));
>    if (EFI_ERROR (Status)) {
> -    goto Error5;
> +    goto Error6;
>    }
> 
>    //
>    // There should be only one EFI_AUTHENTICATION_INFO_PROTOCOL. If
> already exists,
>    // do not produce the protocol instance.
> @@ -1838,17 +1838,20 @@ IScsiDriverEntryPoint (
>    }
> 
>    return EFI_SUCCESS;
> 
>  Error6:
> -  IScsiConfigFormUnload (gIScsiIp4DriverBinding.DriverBindingHandle);
> +  IScsiCleanAttemptVariable ();
> 
>  Error5:
> -  IScsiCleanAttemptVariable ();
> +  IScsiConfigFormUnload (gIScsiIp4DriverBinding.DriverBindingHandle);
> 
>  Error4:
> -  FreePool (mPrivate);
> +  if (mPrivate != NULL) {
> +    FreePool (mPrivate);
> +    mPrivate = NULL;
> +  }
> 
>  Error3:
>    gBS->UninstallMultipleProtocolInterfaces (
>           ImageHandle,
>           &gEfiIScsiInitiatorNameProtocolGuid,
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2017-03-22  3:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22  1:33 [Patch] NetworkPkg/IScsiDxe: Fix the incorrect error handling in DriverEntryPoint Jiaxin Wu
2017-03-22  3:03 ` Zhang, Lubo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7619447B08B8F74DA4FF2A813B79803B39B050EA@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox