diff options
author | Jaejoong Kim <climbbb.kim@gmail.com> | 2018-02-27 11:04:22 +0900 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2018-03-13 10:47:51 +0200 |
commit | 3589cce2b92ba8a11372f2c707adc9eb623efa67 (patch) | |
tree | 0856b907e21337a2d2b300dca55f8e311d8f9497 /drivers/usb/gadget/udc/dummy_hcd.c | |
parent | daaecc6541d014dca073473ec8a4120c0babbeb4 (diff) | |
download | blackbird-obmc-linux-3589cce2b92ba8a11372f2c707adc9eb623efa67.tar.gz blackbird-obmc-linux-3589cce2b92ba8a11372f2c707adc9eb623efa67.zip |
usb: gadget: udc: Use scnprintf() instead of snprintf()
The show() method should use scnprintf() not snprintf() because snprintf()
may returns a value that exceeds its second argument.
Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/udc/dummy_hcd.c')
-rw-r--r-- | drivers/usb/gadget/udc/dummy_hcd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index e744d4b7bfed..baf72f95f0f1 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -2366,7 +2366,7 @@ static inline ssize_t show_urb(char *buf, size_t size, struct urb *urb) { int ep = usb_pipeendpoint(urb->pipe); - return snprintf(buf, size, + return scnprintf(buf, size, "urb/%p %s ep%d%s%s len %d/%d\n", urb, ({ char *s; |