aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-02-27 23:43:12 -0500
committerFelipe Balbi <balbi@ti.com>2013-03-04 06:13:58 -0500
commitfddedd8334d8b4ac6374894d5eed237d18ce1afb (patch)
tree632c27fac1fa3f3322b586667c547227cef8e594 /drivers/usb/gadget
parent57ae575b8a51fd98c9b0066c6c030d5ccce3d77d (diff)
usb: gadget: f_uac1: silence an info leak warning
Smatch complains that "len" could be larger than the sizeof(value) so we could be copying garbage here. I have changed this to match how things are done in composite_setup(). The call tree looks like: composite_setup() --> f_audio_setup() --> audio_get_intf_req() composite_setup() expects the return value to be set to sizeof(value). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/f_uac1.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_uac1.c b/drivers/usb/gadget/f_uac1.c
index f570e667a640..fa8ea4ea00c1 100644
--- a/drivers/usb/gadget/f_uac1.c
+++ b/drivers/usb/gadget/f_uac1.c
@@ -418,6 +418,7 @@ static int audio_get_intf_req(struct usb_function *f,
418 418
419 req->context = audio; 419 req->context = audio;
420 req->complete = f_audio_complete; 420 req->complete = f_audio_complete;
421 len = min_t(size_t, sizeof(value), len);
421 memcpy(req->buf, &value, len); 422 memcpy(req->buf, &value, len);
422 423
423 return len; 424 return len;