Skip to contentSkip to conversation

usb: gadget: uvc: remove an impossible condition

PATCH In review Dan Carpenter 3 participants 3 messages Jan 14, 2015 – Jan 18, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/6 usb: gadget: uvc: remove an impossible condition

"num" is a u32 so "(num > 0xFFFFFFFF)" is never true. Also the range is already checked in kstrtou32().

drivers/usb/gadget/function/uvc_configfs.c +0 -2
index 2bd0688..738d68f 100644
@@ -1156,8 +1156,6 @@ static inline int __uvcg_fill_frm_intrv(char *buf, void *priv)
 	ret = kstrtou32(buf, 0, &num);
 	if (ret)
 		return ret;
-	if (num > 0xFFFFFFFF)
-		return -EINVAL;
 
 	interv = priv;
 	**interv = cpu_to_le32(num);
Acked-by on v1 3/6
#1 lore raw

W dniu 14.01.2015 o 22:02, Dan Carpenter pisze:

Quoted 5 lines

"num" is a u32 so "(num > 0xFFFFFFFF)" is never true. Also the range is already checked in kstrtou32().

Quoted 18 lines
drivers/usb/gadget/function/uvc_configfs.c +0 -3
index 2bd0688..738d68f 100644
@@ -1156,8 +1156,6 @@ static inline int __uvcg_fill_frm_intrv(char *buf, void *priv)
  	ret = kstrtou32(buf, 0, &num);
  	if (ret)
  		return ret;
-	if (num > 0xFFFFFFFF)
-		return -EINVAL;
 
  	interv = priv;
  	**interv = cpu_to_le32(num);
--

To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v1 3/6
#2 lore raw
In reply to Dan Carpenter

Hi Dan,

Thank you for the patch.

Quoted 4 lines · On Thursday 15 January 2015 00:02:18 Dan Carpenter wrote:

"num" is a u32 so "(num > 0xFFFFFFFF)" is never true. Also the range is already checked in kstrtou32().

Quoted 13 lines
(quoted diff) +0 -0

b/drivers/usb/gadget/function/uvc_configfs.c index 2bd0688..738d68f 100644

drivers/usb/gadget/function/uvc_configfs.c +0 -2
@@ -1156,8 +1156,6 @@ static inline int __uvcg_fill_frm_intrv(char *buf,
 void *priv) ret = kstrtou32(buf, 0, &num);
 	if (ret)
 		return ret;
-	if (num > 0xFFFFFFFF)
-		return -EINVAL;
 
 	interv = priv;
 	**interv = cpu_to_le32(num);
Signature · 3 lines
Regards,

Laurent Pinchart