mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 03:16:18 +00:00
Fixed another assert. Removed another redundant assignment.
This commit is contained in:
parent
b04ac8f3be
commit
a28af1be11
@ -597,12 +597,10 @@ pbuf_free(struct pbuf *p)
|
|||||||
|
|
||||||
PERF_START;
|
PERF_START;
|
||||||
|
|
||||||
LWIP_ASSERT("pbuf_free: sane flags", p->flags == PBUF_FLAG_POOL ||
|
LWIP_ASSERT("pbuf_free: sane flags",
|
||||||
p->flags == PBUF_FLAG_ROM ||
|
p->flags == PBUF_FLAG_RAM || p->flags == PBUF_FLAG_ROM ||
|
||||||
p->flags == PBUF_FLAG_RAM ||
|
p->flags == PBUF_FLAG_REF || p->flags == PBUF_FLAG_POOL);
|
||||||
p->flags == PBUF_FLAG_REF );
|
|
||||||
|
|
||||||
q = p;
|
|
||||||
count = 0;
|
count = 0;
|
||||||
/* Since decrementing ref cannot be guaranteed to be a single machine operation
|
/* Since decrementing ref cannot be guaranteed to be a single machine operation
|
||||||
* we must protect it. Also, the later test of ref must be protected.
|
* we must protect it. Also, the later test of ref must be protected.
|
||||||
@ -612,7 +610,7 @@ pbuf_free(struct pbuf *p)
|
|||||||
* obtain a zero reference count */
|
* obtain a zero reference count */
|
||||||
while (p != NULL) {
|
while (p != NULL) {
|
||||||
/* all pbufs in a chain are referenced at least once */
|
/* all pbufs in a chain are referenced at least once */
|
||||||
LWIP_ASSERT("pbuf_free: q->ref > 0", q->ref > 0);
|
LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
|
||||||
p->ref--;
|
p->ref--;
|
||||||
/* this pbuf is no longer referenced to? */
|
/* this pbuf is no longer referenced to? */
|
||||||
if (p->ref == 0)
|
if (p->ref == 0)
|
||||||
@ -679,7 +677,7 @@ pbuf_ref(struct pbuf *p)
|
|||||||
{
|
{
|
||||||
SYS_ARCH_DECL_PROTECT(old_level);
|
SYS_ARCH_DECL_PROTECT(old_level);
|
||||||
/* pbuf given? */
|
/* pbuf given? */
|
||||||
if(p != NULL) {
|
if (p != NULL) {
|
||||||
SYS_ARCH_PROTECT(old_level);
|
SYS_ARCH_PROTECT(old_level);
|
||||||
++(p->ref);
|
++(p->ref);
|
||||||
SYS_ARCH_UNPROTECT(old_level);
|
SYS_ARCH_UNPROTECT(old_level);
|
||||||
|
Loading…
Reference in New Issue
Block a user