drivers/tty/n_hdlc.c: replace kmalloc/memset by kzalloc
authorFabian Frederick <fabf@skynet.be>
Mon, 26 May 2014 19:32:42 +0000 (21:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 May 2014 20:33:18 +0000 (13:33 -0700)
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_hdlc.c

index ef42942a939015f145aff301efc359db97a5128e..644ddb841d9f54085bb82a903034af5aaf42de45 100644 (file)
@@ -848,13 +848,11 @@ static struct n_hdlc *n_hdlc_alloc(void)
 {
        struct n_hdlc_buf *buf;
        int i;
-       struct n_hdlc *n_hdlc = kmalloc(sizeof(*n_hdlc), GFP_KERNEL);
+       struct n_hdlc *n_hdlc = kzalloc(sizeof(*n_hdlc), GFP_KERNEL);
 
        if (!n_hdlc)
                return NULL;
 
-       memset(n_hdlc, 0, sizeof(*n_hdlc));
-
        n_hdlc_buf_list_init(&n_hdlc->rx_free_buf_list);
        n_hdlc_buf_list_init(&n_hdlc->tx_free_buf_list);
        n_hdlc_buf_list_init(&n_hdlc->rx_buf_list);