aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <weiyj.lk@gmail.com>2016-08-21 11:30:50 -0400
committerJiri Kosina <jkosina@suse.cz>2016-08-29 03:36:20 -0400
commit6cf5c1c7162878a99c2fd335d52a7d10079af6b7 (patch)
tree8133ecbb4fe4d81e5cee2d16bdc36c50caa8221d
parente8c61135956ce35fcd7661f52ed3a7e21eb86bfb (diff)
HID: intel_ish-hid: Use kzalloc instead of kmalloc/memset
Use kzalloc rather than kmalloc followed by memset with 0. Generated by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/intel-ish-hid/ishtp/client-buffers.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c
index 3f5ce5ee687e..b9b917d2d50d 100644
--- a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c
+++ b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c
@@ -73,11 +73,10 @@ int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl)
73 for (j = 0; j < cl->tx_ring_size; ++j) { 73 for (j = 0; j < cl->tx_ring_size; ++j) {
74 struct ishtp_cl_tx_ring *tx_buf; 74 struct ishtp_cl_tx_ring *tx_buf;
75 75
76 tx_buf = kmalloc(sizeof(struct ishtp_cl_tx_ring), GFP_KERNEL); 76 tx_buf = kzalloc(sizeof(struct ishtp_cl_tx_ring), GFP_KERNEL);
77 if (!tx_buf) 77 if (!tx_buf)
78 goto out; 78 goto out;
79 79
80 memset(tx_buf, 0, sizeof(struct ishtp_cl_tx_ring));
81 tx_buf->send_buf.data = kmalloc(len, GFP_KERNEL); 80 tx_buf->send_buf.data = kmalloc(len, GFP_KERNEL);
82 if (!tx_buf->send_buf.data) { 81 if (!tx_buf->send_buf.data) {
83 kfree(tx_buf); 82 kfree(tx_buf);