Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: third_party/libusb/src/libusb/os/darwin_usb.c

Issue 23137025: Emergency fix for Mac: crash with EXC_ARITHMETIC in submit_bulk_transfer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/libusb/darwin-sigfpe.patch ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- Mode: C; indent-tabs-mode:nil -*- */ 1 /* -*- Mode: C; indent-tabs-mode:nil -*- */
2 /* 2 /*
3 * darwin backend for libusbx 1.0 3 * darwin backend for libusbx 1.0
4 * Copyright © 2008-2013 Nathan Hjelm <hjelmn@users.sourceforge.net> 4 * Copyright © 2008-2013 Nathan Hjelm <hjelmn@users.sourceforge.net>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public 7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version. 9 * version 2.1 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 struct darwin_interface *cInterface; 1441 struct darwin_interface *cInterface;
1442 1442
1443 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) { 1443 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {
1444 usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface "); 1444 usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface ");
1445 1445
1446 return LIBUSB_ERROR_NOT_FOUND; 1446 return LIBUSB_ERROR_NOT_FOUND;
1447 } 1447 }
1448 1448
1449 cInterface = &priv->interfaces[iface]; 1449 cInterface = &priv->interfaces[iface];
1450 1450
1451 (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number, 1451 ret = (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pi peRef, &direction, &number,
meacer 2013/08/23 16:57:27 GetPipeProperties are called twice more in this fi
Bei Zhang 2013/08/23 17:07:28 Other calls in this file doesn't seem to cause any
meacer 2013/08/23 17:10:04 Sounds good, thanks Bei.
1452 &transferType, &maxPacketSize, &interval); 1452 &transferType, &maxPacket Size, &interval);
1453
1454 if (ret) {
1455 usbi_err (TRANSFER_CTX (transfer), "bulk transfer failed (dir = %s): %s (cod e = 0x%08x)", IS_XFERIN(transfer) ? "In" : "Out",
1456 darwin_error_str(ret), ret);
1457 return darwin_to_libusb (ret);
1458 }
1453 1459
1454 if (0 != (transfer->length % maxPacketSize)) { 1460 if (0 != (transfer->length % maxPacketSize)) {
1455 /* do not need a zero packet */ 1461 /* do not need a zero packet */
1456 transfer->flags &= ~LIBUSB_TRANSFER_ADD_ZERO_PACKET; 1462 transfer->flags &= ~LIBUSB_TRANSFER_ADD_ZERO_PACKET;
1457 } 1463 }
1458 1464
1459 /* submit the request */ 1465 /* submit the request */
1460 /* timeouts are unavailable on interrupt endpoints */ 1466 /* timeouts are unavailable on interrupt endpoints */
1461 if (transferType == kUSBInterrupt) { 1467 if (transferType == kUSBInterrupt) {
1462 if (IS_XFERIN(transfer)) 1468 if (IS_XFERIN(transfer))
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 1900
1895 .handle_events = op_handle_events, 1901 .handle_events = op_handle_events,
1896 1902
1897 .clock_gettime = darwin_clock_gettime, 1903 .clock_gettime = darwin_clock_gettime,
1898 1904
1899 .device_priv_size = sizeof(struct darwin_device_priv), 1905 .device_priv_size = sizeof(struct darwin_device_priv),
1900 .device_handle_priv_size = sizeof(struct darwin_device_handle_priv), 1906 .device_handle_priv_size = sizeof(struct darwin_device_handle_priv),
1901 .transfer_priv_size = sizeof(struct darwin_transfer_priv), 1907 .transfer_priv_size = sizeof(struct darwin_transfer_priv),
1902 .add_iso_packet_size = 0, 1908 .add_iso_packet_size = 0,
1903 }; 1909 };
OLDNEW
« no previous file with comments | « third_party/libusb/darwin-sigfpe.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698