caif: Remove OOM messages, use kzalloc
[pandora-kernel.git] / net / caif / cffrml.c
index 04204b2..f399211 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;