aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/configfs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index c102adbcd4e1..e89aa2877a33 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -915,8 +915,7 @@ static ssize_t webusb_landingPage_store(struct config_item *item, const char *pa
mutex_lock(&gi->lock);
// ensure 0 bytes are set, in case the new landing page is shorter then the old one.
- memset(gi->landing_page, 0, sizeof(gi->landing_page));
- memcpy(gi->landing_page, page, l);
+ memcpy_and_pad(gi->landing_page, sizeof(gi->landing_page), page, l, 0);
mutex_unlock(&gi->lock);
return len;