|
From: Daniel M. \(IMI\) <da...@im...> - 2004-09-28 18:35:04
|
----- Original Message -----
From: "Tom Hughes" <th...@cy...>
To: <rj...@du...>; <da...@im...>
Cc: <val...@li...>
Sent: Tuesday, September 28, 2004 11:24
Subject: Re: [Valgrind-users] improbably "uninitialized value" warning
> In message <014101c4a581$a0840f70$0401a8c0@dan>
> "Daniel Miller \(IMI\)" <da...@im...> wrote:
>
> > static int get_number_of_luns(usb_dev_handle *udev)
> > {
> > char xbuf ;
> > // swap bytes around because u16 fields in
> > // usb_control_msg() are big-endian
> > int result = usb_control_msg(udev, // handle
> > 0xA1, // requesttype
> > 0xFE, // request
> > 0, // value
> > 0, // index
> > &xbuf, // data pointer
> > 1, // length
> > 5000) ; // timeout
> > if (result < 0)
> > return result;
> > result = (int) (xbuf) + 1 ;
> > return result;
> > }
> >
> > The A1/FE control message returns one byte. So it doesn't look, to me,
as
> > though get_number_of_luns() can fail to return a value...
>
> But where does use_control_msg get the value of xbuf from?
>
> Given that this is obviously originating from a USB device it
> is possible that there is some ioctl involved that valgrind
> doesn't understand - do you get any warnings about ioctls?
>
> Tom
Yeah, I get three of the following; I'm still trying to figure out what
0x4B30 is and what to do about them...
==29190== Warning: noted but unhandled ioctl 0x4B30 with no size/direction
hints
==29190== This could cause spurious value errors to appear.
==29190== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
proper wrapper.
However, the usb_control_msg ioctl is 0x5530, not 0x4B30. In any case, if
usb_control_msg fails to get its data, it typically returns -1, and I don't
use xbuf in that case, which is what I was referring to previously...
Dan
|