target_core_rd: break out unterminated loop during copy
authorHannes Reinecke <hare@suse.de>
Wed, 6 Feb 2013 13:42:28 +0000 (14:42 +0100)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 13 Feb 2013 19:54:29 +0000 (11:54 -0800)
commitbbf344e54ed9a76e344d08feedc70ab2c5a8a64c
treee3740b8ca23f80f042b566b97f67bb8f634f0f5e
parent1b7f390eb3bfc197c979c5478eadbc2a90f07667
target_core_rd: break out unterminated loop during copy

The loop in rd_execute_rw() will never terminate if the
sg element has a zero size. Or it'll spill over into
outer space if the sg element is larger than the available
space.
So we need to add some safety catches here.

Cc: Nic Bellinger <nab@risingtidesystems.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_rd.c