mirror of https://github.com/acidanthera/audk.git
NetworkPkg/DxeNetLib: Change the order of conditions in IF statement
The condition, NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len, is meaningless if Index = 0. So checking 'Index != 0' should be performed first in the if statement. Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
This commit is contained in:
parent
7b6327ff03
commit
d3733188a2
|
@ -1063,7 +1063,7 @@ NetbufAllocSpace (
|
|||
} else {
|
||||
NetbufGetByte (Nbuf, 0, &Index);
|
||||
|
||||
if ((NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len) && (Index > 0)) {
|
||||
if ((Index != 0) && (NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len)) {
|
||||
Index--;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue