mirror of
https://github.com/sipeed/LicheeRV-Nano-Build.git
synced 2026-11-09 18:04:55 -06:00
* fix uvc bug
This commit is contained in:
@@ -743,7 +743,7 @@ static const struct uvc_control_mapping uvc_ctrl_mappings[] = {
|
||||
|
||||
static inline u8 *uvc_ctrl_data(struct uvc_control *ctrl, int id)
|
||||
{
|
||||
return ctrl->uvc_data + id * ctrl->info.size;
|
||||
return ctrl->uvc_data + id * ALIGN(ctrl->info.size, 4);
|
||||
}
|
||||
|
||||
static inline int uvc_test_bit(const u8 *data, int bit)
|
||||
@@ -2024,7 +2024,7 @@ static int uvc_ctrl_add_info(struct uvc_device *dev, struct uvc_control *ctrl,
|
||||
INIT_LIST_HEAD(&ctrl->info.mappings);
|
||||
|
||||
/* Allocate an array to save control values (cur, def, max, etc.) */
|
||||
ctrl->uvc_data = kzalloc(ctrl->info.size * UVC_CTRL_DATA_LAST + 1,
|
||||
ctrl->uvc_data = kzalloc(ALIGN(ctrl->info.size, 4) * UVC_CTRL_DATA_LAST + 1,
|
||||
GFP_KERNEL);
|
||||
if (!ctrl->uvc_data)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user