The patch titled usb: make usb_buffer_map_sg consistent with doc has been removed from the -mm tree. Its filename was usb-make-usb_buffer_map_sg-consistent-with-doc.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: usb: make usb_buffer_map_sg consistent with doc From: Jiri Slaby <jirislaby@xxxxxxxxx> 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 <jirislaby@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/usb/core/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/usb/core/usb.c~usb-make-usb_buffer_map_sg-consistent-with-doc drivers/usb/core/usb.c --- a/drivers/usb/core/usb.c~usb-make-usb_buffer_map_sg-consistent-with-doc +++ a/drivers/usb/core/usb.c @@ -914,11 +914,11 @@ int usb_buffer_map_sg(const struct usb_d || !(bus = dev->bus) || !(controller = bus->controller) || !controller->dma_mask) - return -1; + return -EINVAL; /* FIXME generic api broken like pci, can't report errors */ return dma_map_sg(controller, sg, nents, - is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); + is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE) ? : -ENOMEM; } EXPORT_SYMBOL_GPL(usb_buffer_map_sg); _ Patches currently in -mm which might be from jirislaby@xxxxxxxxx are origin.patch linux-next.patch toshiba_acpi-return-on-a-fail-path.patch md-dm-log-fix-cn_ulog_callback-declaration.patch mtd-sst25l-fix-lock-imbalance.patch isdn-hisax-fix-lock-imbalance.patch isdn-eicon-use-offsetof.patch isdn-eicon-return-on-error.patch icom-converting-space-to-tabs.patch cyclades-read-buffer-overflow.patch serial167-fix-read-buffer-overflow.patch video-console-use-div_round_up.patch memory-controller-soft-limit-organize-cgroups-v9-fix.patch cyclades-allow-overriding-isa-defaults-also-when-the-driver-is-built-in.patch drivers-char-rio-rioctrlc-off-by-one-error-in-rioctrlc.patch memstick-move-dev_dbg.patch reiser4.patch fs-reiser4-add-parenths-around-x-y.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html