public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Jiaxin" <jiaxin.wu@intel.com>
To: "Fu, Siyuan" <siyuan.fu@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Ye, Ting" <ting.ye@intel.com>
Subject: Re: [Patch] MdeModulePkg: Update IP4 driver to check for NULL pointer before using.
Date: Thu, 28 Jun 2018 07:13:34 +0000	[thread overview]
Message-ID: <895558F6EA4E3B41AC93A00D163B72741645A913@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20180627011841.13028-1-siyuan.fu@intel.com>

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>


> -----Original Message-----
> From: Fu, Siyuan
> Sent: Wednesday, June 27, 2018 9:19 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting.ye@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [Patch] MdeModulePkg: Update IP4 driver to check for NULL
> pointer before using.
> 
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> index 5a9d828703..6a26143e30 100644
> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> @@ -1048,11 +1048,8 @@ Ip4Groups (
>    // is decreamented each time an address is removed..
>    //
>    for (Index = IpInstance->GroupCount; Index > 0 ; Index--) {
> -    Group = 0;
> -    if(IpInstance->Groups != NULL) {
> -  	  Group = IpInstance->Groups[Index - 1];
> -  	}
> -
> +    ASSERT (IpInstance->Groups != NULL);
> +    Group = IpInstance->Groups[Index - 1];
>      if ((GroupAddress == NULL) || EFI_IP4_EQUAL (&Group, GroupAddress)) {
>        if (EFI_ERROR (Ip4LeaveGroup (IpInstance, NTOHL (Group)))) {
>          return EFI_DEVICE_ERROR;
> --
> 2.13.0.windows.1



      reply	other threads:[~2018-06-28  7:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-27  1:18 [Patch] MdeModulePkg: Update IP4 driver to check for NULL pointer before using Fu Siyuan
2018-06-28  7:13 ` Wu, Jiaxin [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=895558F6EA4E3B41AC93A00D163B72741645A913@SHSMSX103.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