tools/usb/usbip reports errors based on uninitialized value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Consider handling the 'usbip list' command:

Here an uninitialized 'status' variable is declared:
https://github.com/torvalds/linux/blob/master/tools/usb/usbip/src/usbip_list
.c#L54

'status' is provided as an output variable here:
https://github.com/torvalds/linux/blob/master/tools/usb/usbip/src/usbip_list
.c#L62

However, 'usbip_net_recv_op_common' (defined here:
https://github.com/torvalds/linux/blob/master/tools/usb/usbip/src/usbip_netw
ork.c#L162) can fail and return for several reasons before setting 'status'.

The caller uses 'status' (which is still uninitialized) to report an error
text here:
https://github.com/torvalds/linux/blob/master/tools/usb/usbip/src/usbip_list
.c#L65

This leads to random error messages. Sometimes the accidental value of
status maps to a specific error text (which is not informative about the
actual error), but most of the times it will lead to "Unknown Op Common
Status".

F.




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux