diff options
Diffstat (limited to 'net/caif/cfserl.c')
-rw-r--r-- | net/caif/cfserl.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c index 2715c84cfa87..797c8d165993 100644 --- a/net/caif/cfserl.c +++ b/net/caif/cfserl.c | |||
@@ -33,13 +33,10 @@ static void cfserl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl, | |||
33 | 33 | ||
34 | struct cflayer *cfserl_create(int type, int instance, bool use_stx) | 34 | struct cflayer *cfserl_create(int type, int instance, bool use_stx) |
35 | { | 35 | { |
36 | struct cfserl *this = kmalloc(sizeof(struct cfserl), GFP_ATOMIC); | 36 | struct cfserl *this = kzalloc(sizeof(struct cfserl), GFP_ATOMIC); |
37 | if (!this) { | 37 | if (!this) |
38 | pr_warn("Out of memory\n"); | ||
39 | return NULL; | 38 | return NULL; |
40 | } | ||
41 | caif_assert(offsetof(struct cfserl, layer) == 0); | 39 | caif_assert(offsetof(struct cfserl, layer) == 0); |
42 | memset(this, 0, sizeof(struct cfserl)); | ||
43 | this->layer.receive = cfserl_receive; | 40 | this->layer.receive = cfserl_receive; |
44 | this->layer.transmit = cfserl_transmit; | 41 | this->layer.transmit = cfserl_transmit; |
45 | this->layer.ctrlcmd = cfserl_ctrlcmd; | 42 | this->layer.ctrlcmd = cfserl_ctrlcmd; |