Skip to content

Commit

Permalink
* fix uvc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lxowalle committed Nov 28, 2024
1 parent 441888b commit fe0d6c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions linux_5.10/drivers/media/usb/uvc/uvc_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fe0d6c8

Please sign in to comment.