Commit fddedd83 authored by Dan Carpenter's avatar Dan Carpenter Committed by Felipe Balbi

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 57ae575b
...@@ -418,6 +418,7 @@ static int audio_get_intf_req(struct usb_function *f, ...@@ -418,6 +418,7 @@ static int audio_get_intf_req(struct usb_function *f,
req->context = audio; req->context = audio;
req->complete = f_audio_complete; req->complete = f_audio_complete;
len = min_t(size_t, sizeof(value), len);
memcpy(req->buf, &value, len); memcpy(req->buf, &value, len);
return len; return len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment