]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: libiscsi: Remove unnecessary memset() in iscsi_conn_setup()
authorWenchao Hao <haowenchao@huawei.com>
Thu, 17 Mar 2022 15:01:16 +0000 (11:01 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 30 Mar 2022 03:01:28 +0000 (23:01 -0400)
iscsi_cls_conn is alloced by kzalloc(), the whole iscsi_cls_conn is zero
filled already including the dd_data. So it is unnecessary to call memset
again.

Link: https://lore.kernel.org/r/20220317150116.194140-1-haowenchao@huawei.com
Reviewed-by: Wu Bo <wubo40@huawei.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libiscsi.c

index d09926e6c8a86ef225c21f8e7ee2929f9134840c..cf4211c6500d433f6ad7b633f47b2a09f2b8a24e 100644 (file)
@@ -3045,7 +3045,6 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,
        if (!cls_conn)
                return NULL;
        conn = cls_conn->dd_data;
-       memset(conn, 0, sizeof(*conn) + dd_size);
 
        conn->dd_data = cls_conn->dd_data + sizeof(*conn);
        conn->session = session;