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

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