On 3/29/23 2:17 AM, Zhong Jinghua wrote: > From: Zhong Jinghua <zhongjinghua@xxxxxxxxxx> > > The correctness of sock should be checked before assignment to avoid > assigning wrong values. > > Commit > "scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()" > introduced this change. This change may lead to inconsistent values of > tcp_sw_conn->sendpage and conn->datadgst_en. > > Fix it by moving the position of the assignment. > > Fixes: 57569c37f0ad ("scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()") > Signed-off-by: Zhong Jinghua <zhongjinghua@xxxxxxxxxx> Thanks. Reviewed-by: Mike Christie <michael.christie@xxxxxxxxxx>