From 3d7bd2dc232c043ef06cf99bdddcf2e37e9c0f85 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 21 Dec 2010 00:06:16 +0000 Subject: [PATCH] Cosmetical change only: don't shadow the "buffer" parameter with the local variable. Didn't matter, as the parameter is only accessed through the usb_raw_command variable that it is casted to early in the function. CID 5219. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39906 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/drivers/bus/usb/usb_raw.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/add-ons/kernel/drivers/bus/usb/usb_raw.cpp b/src/add-ons/kernel/drivers/bus/usb/usb_raw.cpp index 4634efd665..6476a3f50d 100644 --- a/src/add-ons/kernel/drivers/bus/usb/usb_raw.cpp +++ b/src/add-ons/kernel/drivers/bus/usb/usb_raw.cpp @@ -494,8 +494,8 @@ usb_raw_ioctl(void *cookie, uint32 op, void *buffer, size_t length) } uint8 length = MIN(firstTwoBytes[0], command->descriptor.length); - uint8 *buffer = (uint8 *)malloc(length); - if (!buffer) { + uint8 *descriptorBuffer = (uint8 *)malloc(length); + if (descriptorBuffer == NULL) { command->descriptor.status = B_USB_RAW_STATUS_ABORTED; command->descriptor.length = 0; return B_NO_MEMORY; @@ -503,19 +503,19 @@ usb_raw_ioctl(void *cookie, uint32 op, void *buffer, size_t length) if (gUSBModule->get_descriptor(device->device, command->descriptor.type, command->descriptor.index, - command->descriptor.language_id, buffer, length, + command->descriptor.language_id, descriptorBuffer, length, &actualLength) < B_OK || actualLength != length) { command->descriptor.status = B_USB_RAW_STATUS_ABORTED; command->descriptor.length = 0; - free(buffer); + free(descriptorBuffer); return B_OK; } - memcpy(command->descriptor.data, buffer, length); + memcpy(command->descriptor.data, descriptorBuffer, length); command->descriptor.status = B_USB_RAW_STATUS_SUCCESS; command->descriptor.length = length; - free(buffer); + free(descriptorBuffer); return B_OK; }