diff options
Diffstat (limited to 'net/caif/cfutill.c')
| -rw-r--r-- | net/caif/cfutill.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/caif/cfutill.c b/net/caif/cfutill.c index 98e027db18ed..53e49f3e3af3 100644 --- a/net/caif/cfutill.c +++ b/net/caif/cfutill.c | |||
| @@ -26,13 +26,10 @@ static int cfutill_transmit(struct cflayer *layr, struct cfpkt *pkt); | |||
| 26 | 26 | ||
| 27 | struct cflayer *cfutill_create(u8 channel_id, struct dev_info *dev_info) | 27 | struct cflayer *cfutill_create(u8 channel_id, struct dev_info *dev_info) |
| 28 | { | 28 | { |
| 29 | struct cfsrvl *util = kmalloc(sizeof(struct cfsrvl), GFP_ATOMIC); | 29 | struct cfsrvl *util = kzalloc(sizeof(struct cfsrvl), GFP_ATOMIC); |
| 30 | if (!util) { | 30 | if (!util) |
| 31 | pr_warn("Out of memory\n"); | ||
| 32 | return NULL; | 31 | return NULL; |
| 33 | } | ||
| 34 | caif_assert(offsetof(struct cfsrvl, layer) == 0); | 32 | caif_assert(offsetof(struct cfsrvl, layer) == 0); |
| 35 | memset(util, 0, sizeof(struct cfsrvl)); | ||
| 36 | cfsrvl_init(util, channel_id, dev_info, true); | 33 | cfsrvl_init(util, channel_id, dev_info, true); |
| 37 | util->layer.receive = cfutill_receive; | 34 | util->layer.receive = cfutill_receive; |
| 38 | util->layer.transmit = cfutill_transmit; | 35 | util->layer.transmit = cfutill_transmit; |
