Re: dvb_usb_v2: use pointers to properties[REGRESSION]

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

 



On 06/16/2012 11:17 PM, Malcolm Priestley wrote:
On Sat, 2012-06-16 at 21:41 +0300, Antti Palosaari wrote:


That is what you want to do:
****************************
CALLBACK(struct dvb_usb_adapter *adap)
{
    struct dvb_frontend *fe = adap->fe[adap->active_fe];
    // now we have pointer to adap and fe
}

That is what I want to do:
**************************
CALLBACK(struct dvb_frontend *fe)
{
    struct dvb_usb_adapter *adap = fe->dvb->priv;
    // now we have pointer to adap and fe
}
I just don't like the idea of deliberately sending a NULL object to
a callback.

Same here, I mentioned that many times I will fix it. And it is now fixed, just fetch latest changes.



Ha ... I know what is causing the crash....its in usb_urb.c


int usb_urb_init(struct usb_data_stream *stream,
		struct usb_data_stream_properties *props)
{
	int ret;

	if (stream == NULL || props == NULL)
		return -EINVAL;

	memcpy(&stream->props, props, sizeof(*props));

	usb_clear_halt(stream->udev, usb_rcvbulkpipe(stream->udev,
			stream->props.endpoint));

The usb_clear_halt with 0 endpoint.

It can tweaked by sending a valid endpoint.

Aaah, that explains. Anyhow, I am almost sure usb_clear_halt() will not crash but return error in worst case. You are likely using that endpoint in your driver elsewhere and it is crashing as next operation to endpoint fails. Error in some USB control routines of your driver? It could be also error handling error in dvb usb routines, the idea is to stop device registration and un-register all if there is error. But I haven't tested all the error branches.

Anyhow, check recent patches and I think you are happy.

regards
Antti

--
http://palosaari.fi/


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux