Linux USB
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: frans@biabv.com
Cc: linux-usb@vger.kernel.org
Subject: Re: tools/usb/usbip reports errors based on uninitialized value
Date: Fri, 19 Aug 2022 17:34:48 +0200	[thread overview]
Message-ID: <Yv+tmKNM7dDjnE4l@kroah.com> (raw)
In-Reply-To: <02c301d8b3d3$17a4d760$46ee8620$@biabv.com>

On Fri, Aug 19, 2022 at 03:53:36PM +0200, frans@biabv.com wrote:
> 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".

Please feel free to submit a series of patches for these issues!

thanks,

greg k-h

      reply	other threads:[~2022-08-19 15:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19 13:53 tools/usb/usbip reports errors based on uninitialized value frans
2022-08-19 15:34 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yv+tmKNM7dDjnE4l@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=frans@biabv.com \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox