From: Jiri Slaby Date: Sat, 22 Aug 2009 18:24:49 +0000 (+0200) Subject: USB: make usb_buffer_map_sg consistent with doc X-Git-Tag: v2.6.32-rc1~174^2~35 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2912282c06f219cf1634a624653c445329b37acf;p=pandora-kernel.git USB: make usb_buffer_map_sg consistent with doc usb_buffer_map_sg should return negative on error according to its documentation. But dma_map_sg returns 0 on error. Take this into account and return -ENOMEM in such situation. While at it, return -EINVAL instead of -1 when wrong input is passed in. If this wasn't done, usb_sg_* operations used after usb_sg_init which returned 0 may cause oopses/deadlocks since we don't init structures/entries, esp. completion and status entry. Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed