Skip to contentSkip to conversation

bug in pwc_set_shutter_speed v2.6.30.5 and fix

DISCUSSION Jef Treece 2 participants 3 messages Aug 23, 2009 – Jan 17, 2010 Media (V4L/DVB)

lore
Share & tools
lore

Jef Treece

author
#0 lore raw

I found in recent kernel versions, I think somewhere between 2.6.29.3 and 2.6.30.3, pwc_set_shutter_speed regressed.

I was able to fix it with this one-line change (drivers/media/video/pwc/pwc-ctrl.c line 755 in 2.6.30.5 source):

	ret = send_control_msg(pdev,
		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, sizeof(buf));

change to

	ret = send_control_msg(pdev,
		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, 1);

I hope you find this information useful.

Thank you
Jef Treece

#1 lore raw
Quoted 9 lines · On Sunday 23 August 2009 23:04:00 Jef Treece wrote:

I found in recent kernel versions, I think somewhere between 2.6.29.3 and 2.6.30.3, pwc_set_shutter_speed regressed.

I was able to fix it with this one-line change (drivers/media/video/pwc/pwc-ctrl.c line 755 in 2.6.30.5 source):

	ret = send_control_msg(pdev,
		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, sizeof(buf));
Quoted 6 lines

change to

	ret = send_control_msg(pdev,
		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, 1);

I hope you find this information useful.

This indeed looks like a regression to me.

Martin, as you've introduced the problem, could you look into it and send a patch ? There might be other occurrences of wrong integer -> sizeof conversions, so please review them carefully.

Signature · 3 lines
Regards,

Laurent Pinchart
author
#2 lore raw

I'm pretty sure this is still broken as of 2.6.32.2 Jef Treece

Quoted 23 lines · Laurent Pinchart
Quoted 9 lines · On Sunday 23 August 2009 23:04:00 Jef Treece wrote:

I found in recent kernel versions, I think somewhere between 2.6.29.3 and 2.6.30.3, pwc_set_shutter_speed regressed.

I was able to fix it with this one-line change (drivers/media/video/pwc/pwc-ctrl.c line 755 in 2.6.30.5 source):

	ret = send_control_msg(pdev,
		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, sizeof(buf));
Quoted 6 lines

change to

	ret = send_control_msg(pdev,
		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, 1);

I hope you find this information useful.

This indeed looks like a regression to me.

Martin, as you've introduced the problem, could you look into it and send a patch ? There might be other occurrences of wrong integer -> sizeof conversions, so please review them carefully.