Skip to contentSkip to conversation

Video : pwc : Fix regression in pwc_set_shutter_speed caused by bad constant => sizeof conversion.

PATCH In review Martin Fuzzey 2 participants 2 messages Jan 30, 2010 – Feb 3, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Video : pwc : Fix regression in pwc_set_shutter_speed caused by bad constant => sizeof conversion.

Regression was caused by my commit 6b35ca0d3d586b8ecb8396821af21186e20afaf0 which determined message size using sizeof rather than hardcoded constants.

Unfortunately pwc_set_shutter_speed reuses a 2 byte buffer for a one byte message too so the sizeof was bogus in this case.

All other uses of sizeof checked and are ok.

---

 drivers/media/video/pwc/pwc-ctrl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/pwc/pwc-ctrl.c +1 -1
index 50b415e..f7f7e04 100644
@@ -753,7 +753,7 @@ int pwc_set_shutter_speed(struct pwc_device *pdev, int mode, int value)
 		buf[0] = 0xff; /* fixed */
 
 	ret = send_control_msg(pdev,
-		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, sizeof(buf));
+		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, 1);
 
 	if (!mode && ret >= 0) {
 		if (value < 0)
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Saturday 30 January 2010 17:26:51 Martin Fuzzey wrote:

Regression was caused by my commit 6b35ca0d3d586b8ecb8396821af21186e20afaf0 which determined message size using sizeof rather than hardcoded constants.

Unfortunately pwc_set_shutter_speed reuses a 2 byte buffer for a one byte message too so the sizeof was bogus in this case.

All other uses of sizeof checked and are ok.

Quoted 20 lines

---

 drivers/media/video/pwc/pwc-ctrl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
(quoted diff) +0 -0
 b/drivers/media/video/pwc/pwc-ctrl.c index 50b415e..f7f7e04 100644
drivers/media/video/pwc/pwc-ctrl.c +1 -1
@@ -753,7 +753,7 @@ int pwc_set_shutter_speed(struct pwc_device *pdev, int
 mode, int value) buf[0] = 0xff; /* fixed */
 
 	ret = send_control_msg(pdev,
-		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, sizeof(buf));
+		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, 1);
 
 	if (!mode && ret >= 0) {
 		if (value < 0)
Signature · 3 lines
Regards,

Laurent Pinchart