]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: rtl8712: rtl87x_io : make use of kzalloc
authorHariprasad Kelam <hariprasad.kelam@gmail.com>
Tue, 18 Jun 2019 17:33:05 +0000 (23:03 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Jun 2019 12:39:15 +0000 (14:39 +0200)
kmalloc followed by memset can be replaced with kzalloc.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_io.c

index 17dafeffd6f4f136e4f710ebc931f58f9606e790..87024d6a465e675e1cbf518f97d451cfe6978087 100644 (file)
@@ -107,13 +107,11 @@ uint r8712_alloc_io_queue(struct _adapter *adapter)
        INIT_LIST_HEAD(&pio_queue->processing);
        INIT_LIST_HEAD(&pio_queue->pending);
        spin_lock_init(&pio_queue->lock);
-       pio_queue->pallocated_free_ioreqs_buf = kmalloc(NUM_IOREQ *
+       pio_queue->pallocated_free_ioreqs_buf = kzalloc(NUM_IOREQ *
                                                (sizeof(struct io_req)) + 4,
                                                GFP_ATOMIC);
        if ((pio_queue->pallocated_free_ioreqs_buf) == NULL)
                goto alloc_io_queue_fail;
-       memset(pio_queue->pallocated_free_ioreqs_buf, 0,
-                       (NUM_IOREQ * (sizeof(struct io_req)) + 4));
        pio_queue->free_ioreqs_buf = pio_queue->pallocated_free_ioreqs_buf + 4
                        - ((addr_t)(pio_queue->pallocated_free_ioreqs_buf)
                        & 3);