SCTP: fix wrong debug counting of datamsg
authorLi Zefan <lizf@cn.fujitsu.com>
Thu, 10 Apr 2008 08:57:24 +0000 (01:57 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Apr 2008 08:57:24 +0000 (01:57 -0700)
Should not count it if the allocation of this object
failed.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/chunk.c

index ed857643e3ffdf7f843d6365a701baab51970160..1748ef90950c44c800d06de82bb2999540fe97e4 100644 (file)
@@ -66,9 +66,10 @@ SCTP_STATIC struct sctp_datamsg *sctp_datamsg_new(gfp_t gfp)
 {
        struct sctp_datamsg *msg;
        msg = kmalloc(sizeof(struct sctp_datamsg), gfp);
-       if (msg)
+       if (msg) {
                sctp_datamsg_init(msg);
-       SCTP_DBG_OBJCNT_INC(datamsg);
+               SCTP_DBG_OBJCNT_INC(datamsg);
+       }
        return msg;
 }