From: Paolo Bonzini Date: Fri, 7 Sep 2012 15:30:35 +0000 (+0200) Subject: target: support zero-size allocation lengths in transport_kmap_data_sg X-Git-Tag: v3.6-rc6~3^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3717ef0c63e90686d959158e9728a13a49229be6;p=pandora-kernel.git target: support zero-size allocation lengths in transport_kmap_data_sg In order to support zero-size allocation lengths, do not assert that we have a scatterlist until after checking cmd->data_length. But once we do this, we can have two cases of transport_kmap_data_sg returning NULL: a zero-size allocation length, or an out-of-memory condition. Report the latter using sense codes, so that the SCSI command that triggered it will fail. Signed-off-by: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- Reading git-diff-tree failed