提交 8e25f8ce 编写于 作者: F Fabian Frederick 提交者: Greg Kroah-Hartman

drivers/tty/n_hdlc.c: replace kmalloc/memset by kzalloc

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NFabian Frederick <fabf@skynet.be>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 cec5b2a9
...@@ -848,13 +848,11 @@ static struct n_hdlc *n_hdlc_alloc(void) ...@@ -848,13 +848,11 @@ static struct n_hdlc *n_hdlc_alloc(void)
{ {
struct n_hdlc_buf *buf; struct n_hdlc_buf *buf;
int i; 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) if (!n_hdlc)
return NULL; 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->rx_free_buf_list);
n_hdlc_buf_list_init(&n_hdlc->tx_free_buf_list); n_hdlc_buf_list_init(&n_hdlc->tx_free_buf_list);
n_hdlc_buf_list_init(&n_hdlc->rx_buf_list); n_hdlc_buf_list_init(&n_hdlc->rx_buf_list);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册