[PATCH 2/2] SCTP: fix wrong debug counting of bind_bucket

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Li Zefan
Date: Monday, March 31, 2008 - 8:42 pm

Should not count it if the allocation of the object
is failed.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 net/sctp/socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index d994d82..698b741 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5761,8 +5761,8 @@ static struct sctp_bind_bucket *sctp_bucket_create(
 	struct sctp_bind_bucket *pp;
 
 	pp = kmem_cache_alloc(sctp_bucket_cachep, GFP_ATOMIC);
-	SCTP_DBG_OBJCNT_INC(bind_bucket);
 	if (pp) {
+		SCTP_DBG_OBJCNT_INC(bind_bucket);
 		pp->port = snum;
 		pp->fastreuse = 0;
 		INIT_HLIST_HEAD(&pp->owner);
-- 
1.5.4.rc3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/2] SCTP: fix wrong debug counting of bind_bucket, Li Zefan, (Mon Mar 31, 8:42 pm)