From: Matthew Wilcox Date: Thu, 12 May 2011 17:51:41 +0000 (-0400) Subject: NVMe: Handle failures from memory allocations in nvme_setup_prps X-Git-Tag: v3.3-rc1~16^2~26 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b77954cbddff28d55a36fad3c16f4daebb0f01df;p=pandora-kernel.git NVMe: Handle failures from memory allocations in nvme_setup_prps If any of the memory allocations in nvme_setup_prps fail, handle it by modifying the passed-in data length to reflect the number of bytes we are actually able to send. Also allow the caller to specify the GFP flags they need; for user-initiated commands, we can use GFP_KERNEL allocations. The various callers are updated to handle this possibility; the main I/O path is already prepared for this possibility (as it may happen due to nvme_map_bio being unable to map all the segments of the I/O). The other callers return -ENOMEM instead of doing partial I/Os. Reported-by: Andi Kleen Signed-off-by: Matthew Wilcox --- Reading git-diff-tree failed