summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2018-01-05 15:47:27 -0800
committerChris Dickens <christopher.a.dickens@gmail.com>2018-01-06 21:18:43 -0800
commitaacfff6284ae9e6e353304b8a19422aecc5c0b8e (patch)
tree34a71fe5696f443419ec629b9ca523a78fdf2a22
parentaf66830223330511bfa57a384a6880bff89cca7b (diff)
downloadlibusb-aacfff6284ae9e6e353304b8a19422aecc5c0b8e.tar.gz
Windows: UsbDk: Return appropriate error code for malloc failure
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
-rw-r--r--libusb/os/windows_usbdk.c10
-rw-r--r--libusb/version_nano.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/libusb/os/windows_usbdk.c b/libusb/os/windows_usbdk.c
index 59d8738..ee7d238 100644
--- a/libusb/os/windows_usbdk.c
+++ b/libusb/os/windows_usbdk.c
@@ -595,7 +595,7 @@ static int usbdk_do_bulk_transfer(struct usbi_transfer *itransfer)
transfer_priv->request.TransferType = InterruptTransferType;
break;
default:
- usbi_err(ctx, "Wrong transfer type (%d) in usbdk_do_bulk_transfer. %s", transfer->type, windows_error_str(0));
+ usbi_err(ctx, "Wrong transfer type (%d) in usbdk_do_bulk_transfer", transfer->type);
return LIBUSB_ERROR_INVALID_PARAM;
}
@@ -647,16 +647,16 @@ static int usbdk_do_iso_transfer(struct usbi_transfer *itransfer)
transfer_priv->IsochronousPacketsArray = malloc(transfer->num_iso_packets * sizeof(ULONG64));
transfer_priv->request.IsochronousPacketsArray = (PVOID64)transfer_priv->IsochronousPacketsArray;
if (!transfer_priv->IsochronousPacketsArray) {
- usbi_err(ctx, "Allocation of IsochronousPacketsArray is failed, %s", windows_error_str(0));
- return LIBUSB_ERROR_IO;
+ usbi_err(ctx, "Allocation of IsochronousPacketsArray failed");
+ return LIBUSB_ERROR_NO_MEM;
}
transfer_priv->IsochronousResultsArray = malloc(transfer->num_iso_packets * sizeof(USB_DK_ISO_TRANSFER_RESULT));
transfer_priv->request.Result.IsochronousResultsArray = (PVOID64)transfer_priv->IsochronousResultsArray;
if (!transfer_priv->IsochronousResultsArray) {
- usbi_err(ctx, "Allocation of isochronousResultsArray is failed, %s", windows_error_str(0));
+ usbi_err(ctx, "Allocation of isochronousResultsArray failed");
free(transfer_priv->IsochronousPacketsArray);
- return LIBUSB_ERROR_IO;
+ return LIBUSB_ERROR_NO_MEM;
}
for (i = 0; i < transfer->num_iso_packets; i++)
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 2364522..414effd 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11270
+#define LIBUSB_NANO 11271