Skip to content

Commit

Permalink
scsi: libiscsi: Remove unnecessary memset() in iscsi_conn_setup()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wenchao Hao authored and Martin K. Petersen committed Mar 30, 2022
1 parent 87d663d commit ebfe3e0
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ebfe3e0

Please sign in to comment.