Bluetooth: hci_conn: Remove redundant memset after kzalloc
authorKuan-Wei Chiu <visitorckw@gmail.com>
Sat, 10 Aug 2024 14:14:15 +0000 (22:14 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 10 Sep 2024 17:04:59 +0000 (13:04 -0400)
Since kzalloc already zeroes the allocated memory, the subsequent
memset call is unnecessary. This patch removes the redundant memset to
clean up the code and enhance efficiency.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_conn.c

index c82502e213a88a2623c643091f963aa6402e75ad..323d397b0e920a6dc2f44cf68348460d0844af4e 100644 (file)
@@ -778,7 +778,6 @@ static int hci_le_big_terminate(struct hci_dev *hdev, u8 big, struct hci_conn *c
        if (!d)
                return -ENOMEM;
 
-       memset(d, 0, sizeof(*d));
        d->big = big;
        d->sync_handle = conn->sync_handle;