Blame SOURCES/0004-Linux-Improved-system-out-of-memory-handling.patch

311d97
From d3018d249a98fcf93d36baec32b80b7ef5a8ee68 Mon Sep 17 00:00:00 2001
311d97
From: Slash Gordon <slash.gordon.dev@gmail.com>
311d97
Date: Tue, 3 Dec 2019 12:47:38 +0100
311d97
Subject: [PATCH 04/10] Linux: Improved system out of memory handling
311d97
311d97
Maps ENOMEM system error to LIBUSB_ERROR_NO_MEM.
311d97
311d97
(cherry picked from commit 97ece77c4a6eaafd0a74fd3b73e290ec97d71eb5)
311d97
---
311d97
 libusb/os/linux_usbfs.c | 2 ++
311d97
 libusb/version_nano.h   | 2 +-
311d97
 2 files changed, 3 insertions(+), 1 deletion(-)
311d97
311d97
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
311d97
index dace935..53530cd 100644
311d97
--- a/libusb/os/linux_usbfs.c
311d97
+++ b/libusb/os/linux_usbfs.c
311d97
@@ -2079,6 +2079,8 @@ static int submit_bulk_transfer(struct usbi_transfer *itransfer)
311d97
 		if (r < 0) {
311d97
 			if (errno == ENODEV) {
311d97
 				r = LIBUSB_ERROR_NO_DEVICE;
311d97
+			} else if (errno == ENOMEM) {
311d97
+				r = LIBUSB_ERROR_NO_MEM;
311d97
 			} else {
311d97
 				usbi_err(TRANSFER_CTX(transfer),
311d97
 					"submiturb failed error %d errno=%d", r, errno);
311d97
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
311d97
index aebe182..41a03d1 100644
311d97
--- a/libusb/version_nano.h
311d97
+++ b/libusb/version_nano.h
311d97
@@ -1 +1 @@
311d97
-#define LIBUSB_NANO 11411
311d97
+#define LIBUSB_NANO 11412
311d97
-- 
311d97
2.26.1
311d97