Skip to content

Commit 6cf5c1c

Browse files
weiyjJiri Kosina
authored andcommitted
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 <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent e8c6113 commit 6cf5c1c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/hid/intel-ish-hid/ishtp/client-buffers.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,10 @@ int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl)
7373
for (j = 0; j < cl->tx_ring_size; ++j) {
7474
struct ishtp_cl_tx_ring *tx_buf;
7575

76-
tx_buf = kmalloc(sizeof(struct ishtp_cl_tx_ring), GFP_KERNEL);
76+
tx_buf = kzalloc(sizeof(struct ishtp_cl_tx_ring), GFP_KERNEL);
7777
if (!tx_buf)
7878
goto out;
7979

80-
memset(tx_buf, 0, sizeof(struct ishtp_cl_tx_ring));
8180
tx_buf->send_buf.data = kmalloc(len, GFP_KERNEL);
8281
if (!tx_buf->send_buf.data) {
8382
kfree(tx_buf);

0 commit comments

Comments
 (0)