Commit 3e9e01de5ed3fb2810215e2a3b479e7585785ac0

Authored by Nicholas Bellinger
1 parent 15c03dd485

target: Fix xop->dbl assignment in target_xcopy_parse_segdesc_02

This patch fixes up an incorrect assignment for xop->dbl within
target_xcopy_parse_segdesc_02() code, as reported by Coverity here:

http://marc.info/?l=linux-kernel&m=137936416618490&w=2

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/target/target_core_xcopy.c
... ... @@ -298,8 +298,8 @@
298 298 (unsigned long long)xop->dst_lba);
299 299  
300 300 if (dc != 0) {
301   - xop->dbl = (desc[29] << 16) & 0xff;
302   - xop->dbl |= (desc[30] << 8) & 0xff;
  301 + xop->dbl = (desc[29] & 0xff) << 16;
  302 + xop->dbl |= (desc[30] & 0xff) << 8;
303 303 xop->dbl |= desc[31] & 0xff;
304 304  
305 305 pr_debug("XCOPY seg desc 0x02: DC=1 w/ dbl: %u\n", xop->dbl);