scsi: target: iscsi: Fix data digest calculation
authorVarun Prakash <varun@chelsio.com>
Tue, 25 Aug 2020 12:35:10 +0000 (18:05 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 06:46:12 +0000 (08:46 +0200)
commitacfe0c7b8c2f3c1578f44a10388c9b485b56dba1
tree439a09f410ab78a0a0b3152ddbd1a84e82cad516
parent37457ac5a36c6e4f6c8b9064b7f52c55e6b0f190
scsi: target: iscsi: Fix data digest calculation

commit 5528d03183fe5243416c706f64b1faa518b05130 upstream.

Current code does not consider 'page_off' in data digest calculation. To
fix this, add a local variable 'first_sg' and set first_sg.offset to
sg->offset + page_off.

Link: https://lore.kernel.org/r/1598358910-3052-1-git-send-email-varun@chelsio.com
Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Cc: <stable@vger.kernel.org>
Reviewed-by: Mike Christie <michael.christie@oralce.com>
Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/iscsi/iscsi_target.c