Linux USB
 help / color / mirror / Atom feed
* tools/usb/usbip reports errors based on uninitialized value
@ 2022-08-19 13:53 frans
  2022-08-19 15:34 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: frans @ 2022-08-19 13:53 UTC (permalink / raw)
  To: linux-usb

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-19 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-19 13:53 tools/usb/usbip reports errors based on uninitialized value frans
2022-08-19 15:34 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox