USB: composite: Use snprintf instead of sprintf
composite driver is using sprintf() function to expose value to userspace. This sprintf() is banned function and instead required to use snprintf() function. Hence replace sprintf() with snprintf() function to fix static analysis tool error. Change-Id: I85f38fe3f2121f6a0cb76b7178a3e699ba1dc7f2 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
This commit is contained in:
parent
8aedd70842
commit
37a389ae91
1 changed files with 1 additions and 1 deletions
|
@ -2088,7 +2088,7 @@ static ssize_t suspended_show(struct device *dev, struct device_attribute *attr,
|
||||||
struct usb_gadget *gadget = dev_to_usb_gadget(dev);
|
struct usb_gadget *gadget = dev_to_usb_gadget(dev);
|
||||||
struct usb_composite_dev *cdev = get_gadget_data(gadget);
|
struct usb_composite_dev *cdev = get_gadget_data(gadget);
|
||||||
|
|
||||||
return sprintf(buf, "%d\n", cdev->suspended);
|
return snprintf(buf, PAGE_SIZE, "%d\n", cdev->suspended);
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RO(suspended);
|
static DEVICE_ATTR_RO(suspended);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue