Zhong Jinghua 6e06a68fbb scsi: iscsi_tcp: Check that sock is valid before iscsi_set_param()
[ Upstream commit 48b19b79cfa37b1e50da3b5a8af529f994c08901 ]

The validity of sock should be checked before assignment to avoid incorrect
values. Commit 57569c37f0ad ("scsi: iscsi: iscsi_tcp: Fix null-ptr-deref
while calling getpeername()") introduced this change which may lead to
inconsistent values of tcp_sw_conn->sendpage and conn->datadgst_en.

Fix the issue 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@huawei.com>
Link: https://lore.kernel.org/r/20230329071739.2175268-1-zhongjinghua@huaweicloud.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-13 16:55:31 +02:00
..
2022-08-04 19:47:37 -07:00
2022-05-23 23:24:10 -04:00
2022-10-07 12:33:18 -07:00
2022-02-22 21:11:02 -05:00
2022-07-26 22:13:29 -04:00
2022-02-22 21:11:02 -05:00
2022-06-27 22:56:21 -04:00
2022-01-25 00:09:41 -05:00
2022-02-22 21:11:02 -05:00
2022-10-07 12:33:18 -07:00
2022-10-07 12:33:18 -07:00
2022-01-22 08:33:37 +02:00
2022-05-08 14:28:18 -04:00
2021-12-22 23:41:13 -05:00
2022-06-28 06:30:26 -06:00
2022-10-07 12:33:18 -07:00
2022-10-07 12:33:18 -07:00