diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2016-06-02 16:19:00 +0530 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2016-06-07 18:17:58 +1000 |
commit | 4202498ebf51847213d53cb450962d82463f6cb5 (patch) | |
tree | 11789068ddbf05aeaefb2974969ec3311c9e2036 /lib/libusb | |
parent | 705b46012bfb3d7615f5839916f3dbdc42b1b550 (diff) | |
download | SLOF-4202498ebf51847213d53cb450962d82463f6cb5.zip SLOF-4202498ebf51847213d53cb450962d82463f6cb5.tar.gz SLOF-4202498ebf51847213d53cb450962d82463f6cb5.tar.bz2 |
usb-xhci: assign field4 before conditional
Static analysis tool reported:
file lib/libusb/usb-xhci.c
line 1022
uninitialized `field4'
file lib/libusb/usb-xhci.c
line 1036
uninitialized `field4'
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib/libusb')
-rw-r--r-- | lib/libusb/usb-xhci.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libusb/usb-xhci.c b/lib/libusb/usb-xhci.c index 3bbc9af..a3e9adc 100644 --- a/lib/libusb/usb-xhci.c +++ b/lib/libusb/usb-xhci.c @@ -1017,9 +1017,9 @@ static void fill_setup_data(struct xhci_command_trb *cmd, void *data, field1 = TRB_ADDR_LOW(data); field2 = TRB_ADDR_HIGH(data); field3 = size; + field4 = TRB_CMD_TYPE(TRB_DATA_STAGE); if (dir) - field4 = TRB_DIR_IN; - field4 |= TRB_CMD_TYPE(TRB_DATA_STAGE); + field4 |= TRB_DIR_IN; fill_trb_buff(cmd, field1, field2, field3, field4); } @@ -1030,10 +1030,9 @@ static void fill_status_trb(struct xhci_command_trb *cmd, uint32_t dir) field1 = 0; field2 = 0; field3 = 0; + field4 = TRB_CMD_TYPE(TRB_STATUS_STAGE) | TRB_IOC; if (dir) - field4 = TRB_DIR_IN; - - field4 |= TRB_CMD_TYPE(TRB_STATUS_STAGE) | TRB_IOC; + field4 |= TRB_DIR_IN; fill_trb_buff(cmd, field1, field2, field3, field4); } |