* [patch 1/2] usb: gadget: printer: delete some dead code
@ 2015-03-13 9:11 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-03-13 9:11 UTC (permalink / raw)
To: kernel-janitors
"num" is a u16 so it can't go higher than 65535. kstrtou16() has a
range check built in so this is already handled.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
index 757fcf0..caa56de 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -1223,11 +1223,6 @@ static ssize_t f_printer_opts_q_len_store(struct f_printer_opts *opts,
if (ret)
goto end;
- if (num > 65535) {
- ret = -EINVAL;
- goto end;
- }
-
opts->q_len = (unsigned)num;
ret = len;
end:
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-13 9:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-13 9:11 [patch 1/2] usb: gadget: printer: delete some dead code Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox