]> Pileus Git - ~andy/linux/blobdiff - net/caif/cfserl.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[~andy/linux] / net / caif / cfserl.c
index 2715c84cfa871f58fdd7c4bfbfb87302806f2a19..797c8d165993f556b954b6c7aea9fd31540adbe0 100644 (file)
@@ -33,13 +33,10 @@ static void cfserl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl,
 
 struct cflayer *cfserl_create(int type, int instance, bool use_stx)
 {
-       struct cfserl *this = kmalloc(sizeof(struct cfserl), GFP_ATOMIC);
-       if (!this) {
-               pr_warn("Out of memory\n");
+       struct cfserl *this = kzalloc(sizeof(struct cfserl), GFP_ATOMIC);
+       if (!this)
                return NULL;
-       }
        caif_assert(offsetof(struct cfserl, layer) == 0);
-       memset(this, 0, sizeof(struct cfserl));
        this->layer.receive = cfserl_receive;
        this->layer.transmit = cfserl_transmit;
        this->layer.ctrlcmd = cfserl_ctrlcmd;