]> Pileus Git - ~andy/linux/blobdiff - net/caif/cffrml.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[~andy/linux] / net / caif / cffrml.c
index 04204b2027186ef84df3ca116f849a35d902e3e9..f39921171d0d94e51e1270891a6703be598d01e9 100644 (file)
@@ -34,11 +34,9 @@ static u32 cffrml_rcv_error;
 static u32 cffrml_rcv_checsum_error;
 struct cflayer *cffrml_create(u16 phyid, bool use_fcs)
 {
-       struct cffrml *this = kmalloc(sizeof(struct cffrml), GFP_ATOMIC);
-       if (!this) {
-               pr_warn("Out of memory\n");
+       struct cffrml *this = kzalloc(sizeof(struct cffrml), GFP_ATOMIC);
+       if (!this)
                return NULL;
-       }
        this->pcpu_refcnt = alloc_percpu(int);
        if (this->pcpu_refcnt == NULL) {
                kfree(this);
@@ -47,7 +45,6 @@ struct cflayer *cffrml_create(u16 phyid, bool use_fcs)
 
        caif_assert(offsetof(struct cffrml, layer) == 0);
 
-       memset(this, 0, sizeof(struct cflayer));
        this->layer.receive = cffrml_receive;
        this->layer.transmit = cffrml_transmit;
        this->layer.ctrlcmd = cffrml_ctrlcmd;