Skip to content

Commit b620ed2

Browse files
committed
merge
2 parents 2f3eba0 + 4a245d5 commit b620ed2

File tree

20 files changed

+165
-59
lines changed

20 files changed

+165
-59
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 17
4-
SUBLEVEL = 0
4+
SUBLEVEL = 1
55
EXTRAVERSION =
66
NAME = Baby Opossum Posse
77

block/blk-mq-tag.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
622622
return -ENOMEM;
623623

624624
blk_mq_free_map_and_rqs(set, *tagsptr, hctx->queue_num);
625+
hctx->queue->elevator->et->tags[hctx->queue_num] = new;
625626
*tagsptr = new;
626627
} else {
627628
/*

drivers/media/i2c/tc358743.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,10 +2245,10 @@ static int tc358743_probe(struct i2c_client *client)
22452245
err_work_queues:
22462246
cec_unregister_adapter(state->cec_adap);
22472247
if (!state->i2c_client->irq) {
2248-
timer_delete(&state->timer);
2248+
timer_delete_sync(&state->timer);
22492249
flush_work(&state->work_i2c_poll);
22502250
}
2251-
cancel_delayed_work(&state->delayed_work_enable_hotplug);
2251+
cancel_delayed_work_sync(&state->delayed_work_enable_hotplug);
22522252
mutex_destroy(&state->confctl_mutex);
22532253
err_hdl:
22542254
media_entity_cleanup(&sd->entity);

drivers/media/pci/b2c2/flexcop-pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ static void flexcop_pci_remove(struct pci_dev *pdev)
411411
struct flexcop_pci *fc_pci = pci_get_drvdata(pdev);
412412

413413
if (irq_chk_intv > 0)
414-
cancel_delayed_work(&fc_pci->irq_check_work);
414+
cancel_delayed_work_sync(&fc_pci->irq_check_work);
415415

416416
flexcop_pci_dma_exit(fc_pci);
417417
flexcop_device_exit(fc_pci->fc_dev);

drivers/media/platform/qcom/iris/iris_buffer.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,16 @@ static int iris_destroy_internal_buffers(struct iris_inst *inst, u32 plane, bool
413413
}
414414
}
415415

416+
if (force) {
417+
buffers = &inst->buffers[BUF_PERSIST];
418+
419+
list_for_each_entry_safe(buf, next, &buffers->list, list) {
420+
ret = iris_destroy_internal_buffer(inst, buf);
421+
if (ret)
422+
return ret;
423+
}
424+
}
425+
416426
return 0;
417427
}
418428

drivers/media/platform/st/stm32/stm32-csi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,7 @@ static void stm32_csi_phy_reg_write(struct stm32_csi_dev *csidev,
443443
static int stm32_csi_start(struct stm32_csi_dev *csidev,
444444
struct v4l2_subdev_state *state)
445445
{
446-
struct media_pad *src_pad =
447-
&csidev->s_subdev->entity.pads[csidev->s_subdev_pad_nb];
446+
struct media_pad *src_pad;
448447
const struct stm32_csi_mbps_phy_reg *phy_regs = NULL;
449448
struct v4l2_mbus_framefmt *sink_fmt;
450449
const struct stm32_csi_fmts *fmt;
@@ -466,6 +465,7 @@ static int stm32_csi_start(struct stm32_csi_dev *csidev,
466465
if (!csidev->s_subdev)
467466
return -EIO;
468467

468+
src_pad = &csidev->s_subdev->entity.pads[csidev->s_subdev_pad_nb];
469469
link_freq = v4l2_get_link_freq(src_pad,
470470
fmt->bpp, 2 * csidev->num_lanes);
471471
if (link_freq < 0)

drivers/media/rc/imon.c

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,9 @@ static int display_open(struct inode *inode, struct file *file)
536536

537537
mutex_lock(&ictx->lock);
538538

539-
if (!ictx->display_supported) {
539+
if (ictx->disconnected) {
540+
retval = -ENODEV;
541+
} else if (!ictx->display_supported) {
540542
pr_err("display not supported by device\n");
541543
retval = -ENODEV;
542544
} else if (ictx->display_isopen) {
@@ -598,6 +600,9 @@ static int send_packet(struct imon_context *ictx)
598600
int retval = 0;
599601
struct usb_ctrlrequest *control_req = NULL;
600602

603+
if (ictx->disconnected)
604+
return -ENODEV;
605+
601606
/* Check if we need to use control or interrupt urb */
602607
if (!ictx->tx_control) {
603608
pipe = usb_sndintpipe(ictx->usbdev_intf0,
@@ -949,12 +954,14 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
949954
static const unsigned char vfd_packet6[] = {
950955
0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF };
951956

952-
if (ictx->disconnected)
953-
return -ENODEV;
954-
955957
if (mutex_lock_interruptible(&ictx->lock))
956958
return -ERESTARTSYS;
957959

960+
if (ictx->disconnected) {
961+
retval = -ENODEV;
962+
goto exit;
963+
}
964+
958965
if (!ictx->dev_present_intf0) {
959966
pr_err_ratelimited("no iMON device present\n");
960967
retval = -ENODEV;
@@ -1029,11 +1036,13 @@ static ssize_t lcd_write(struct file *file, const char __user *buf,
10291036
int retval = 0;
10301037
struct imon_context *ictx = file->private_data;
10311038

1032-
if (ictx->disconnected)
1033-
return -ENODEV;
1034-
10351039
mutex_lock(&ictx->lock);
10361040

1041+
if (ictx->disconnected) {
1042+
retval = -ENODEV;
1043+
goto exit;
1044+
}
1045+
10371046
if (!ictx->display_supported) {
10381047
pr_err_ratelimited("no iMON display present\n");
10391048
retval = -ENODEV;
@@ -2499,7 +2508,11 @@ static void imon_disconnect(struct usb_interface *interface)
24992508
int ifnum;
25002509

25012510
ictx = usb_get_intfdata(interface);
2511+
2512+
mutex_lock(&ictx->lock);
25022513
ictx->disconnected = true;
2514+
mutex_unlock(&ictx->lock);
2515+
25032516
dev = ictx->dev;
25042517
ifnum = interface->cur_altsetting->desc.bInterfaceNumber;
25052518

drivers/media/tuners/xc5000.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ static void xc5000_release(struct dvb_frontend *fe)
13041304
mutex_lock(&xc5000_list_mutex);
13051305

13061306
if (priv) {
1307-
cancel_delayed_work(&priv->timer_sleep);
1307+
cancel_delayed_work_sync(&priv->timer_sleep);
13081308
hybrid_tuner_release_state(priv);
13091309
}
13101310

drivers/media/usb/uvc/uvc_driver.c

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ struct uvc_entity *uvc_entity_by_id(struct uvc_device *dev, int id)
137137
{
138138
struct uvc_entity *entity;
139139

140+
if (id == UVC_INVALID_ENTITY_ID)
141+
return NULL;
142+
140143
list_for_each_entry(entity, &dev->entities, list) {
141144
if (entity->id == id)
142145
return entity;
@@ -795,14 +798,27 @@ static const u8 uvc_media_transport_input_guid[16] =
795798
UVC_GUID_UVC_MEDIA_TRANSPORT_INPUT;
796799
static const u8 uvc_processing_guid[16] = UVC_GUID_UVC_PROCESSING;
797800

798-
static struct uvc_entity *uvc_alloc_entity(u16 type, u16 id,
799-
unsigned int num_pads, unsigned int extra_size)
801+
static struct uvc_entity *uvc_alloc_new_entity(struct uvc_device *dev, u16 type,
802+
u16 id, unsigned int num_pads,
803+
unsigned int extra_size)
800804
{
801805
struct uvc_entity *entity;
802806
unsigned int num_inputs;
803807
unsigned int size;
804808
unsigned int i;
805809

810+
/* Per UVC 1.1+ spec 3.7.2, the ID should be non-zero. */
811+
if (id == 0) {
812+
dev_err(&dev->intf->dev, "Found Unit with invalid ID 0\n");
813+
id = UVC_INVALID_ENTITY_ID;
814+
}
815+
816+
/* Per UVC 1.1+ spec 3.7.2, the ID is unique. */
817+
if (uvc_entity_by_id(dev, id)) {
818+
dev_err(&dev->intf->dev, "Found multiple Units with ID %u\n", id);
819+
id = UVC_INVALID_ENTITY_ID;
820+
}
821+
806822
extra_size = roundup(extra_size, sizeof(*entity->pads));
807823
if (num_pads)
808824
num_inputs = type & UVC_TERM_OUTPUT ? num_pads : num_pads - 1;
@@ -812,7 +828,7 @@ static struct uvc_entity *uvc_alloc_entity(u16 type, u16 id,
812828
+ num_inputs;
813829
entity = kzalloc(size, GFP_KERNEL);
814830
if (entity == NULL)
815-
return NULL;
831+
return ERR_PTR(-ENOMEM);
816832

817833
entity->id = id;
818834
entity->type = type;
@@ -924,10 +940,10 @@ static int uvc_parse_vendor_control(struct uvc_device *dev,
924940
break;
925941
}
926942

927-
unit = uvc_alloc_entity(UVC_VC_EXTENSION_UNIT, buffer[3],
928-
p + 1, 2*n);
929-
if (unit == NULL)
930-
return -ENOMEM;
943+
unit = uvc_alloc_new_entity(dev, UVC_VC_EXTENSION_UNIT,
944+
buffer[3], p + 1, 2 * n);
945+
if (IS_ERR(unit))
946+
return PTR_ERR(unit);
931947

932948
memcpy(unit->guid, &buffer[4], 16);
933949
unit->extension.bNumControls = buffer[20];
@@ -1036,10 +1052,10 @@ static int uvc_parse_standard_control(struct uvc_device *dev,
10361052
return -EINVAL;
10371053
}
10381054

1039-
term = uvc_alloc_entity(type | UVC_TERM_INPUT, buffer[3],
1040-
1, n + p);
1041-
if (term == NULL)
1042-
return -ENOMEM;
1055+
term = uvc_alloc_new_entity(dev, type | UVC_TERM_INPUT,
1056+
buffer[3], 1, n + p);
1057+
if (IS_ERR(term))
1058+
return PTR_ERR(term);
10431059

10441060
if (UVC_ENTITY_TYPE(term) == UVC_ITT_CAMERA) {
10451061
term->camera.bControlSize = n;
@@ -1095,10 +1111,10 @@ static int uvc_parse_standard_control(struct uvc_device *dev,
10951111
return 0;
10961112
}
10971113

1098-
term = uvc_alloc_entity(type | UVC_TERM_OUTPUT, buffer[3],
1099-
1, 0);
1100-
if (term == NULL)
1101-
return -ENOMEM;
1114+
term = uvc_alloc_new_entity(dev, type | UVC_TERM_OUTPUT,
1115+
buffer[3], 1, 0);
1116+
if (IS_ERR(term))
1117+
return PTR_ERR(term);
11021118

11031119
memcpy(term->baSourceID, &buffer[7], 1);
11041120

@@ -1117,9 +1133,10 @@ static int uvc_parse_standard_control(struct uvc_device *dev,
11171133
return -EINVAL;
11181134
}
11191135

1120-
unit = uvc_alloc_entity(buffer[2], buffer[3], p + 1, 0);
1121-
if (unit == NULL)
1122-
return -ENOMEM;
1136+
unit = uvc_alloc_new_entity(dev, buffer[2], buffer[3],
1137+
p + 1, 0);
1138+
if (IS_ERR(unit))
1139+
return PTR_ERR(unit);
11231140

11241141
memcpy(unit->baSourceID, &buffer[5], p);
11251142

@@ -1139,9 +1156,9 @@ static int uvc_parse_standard_control(struct uvc_device *dev,
11391156
return -EINVAL;
11401157
}
11411158

1142-
unit = uvc_alloc_entity(buffer[2], buffer[3], 2, n);
1143-
if (unit == NULL)
1144-
return -ENOMEM;
1159+
unit = uvc_alloc_new_entity(dev, buffer[2], buffer[3], 2, n);
1160+
if (IS_ERR(unit))
1161+
return PTR_ERR(unit);
11451162

11461163
memcpy(unit->baSourceID, &buffer[4], 1);
11471164
unit->processing.wMaxMultiplier =
@@ -1168,9 +1185,10 @@ static int uvc_parse_standard_control(struct uvc_device *dev,
11681185
return -EINVAL;
11691186
}
11701187

1171-
unit = uvc_alloc_entity(buffer[2], buffer[3], p + 1, n);
1172-
if (unit == NULL)
1173-
return -ENOMEM;
1188+
unit = uvc_alloc_new_entity(dev, buffer[2], buffer[3],
1189+
p + 1, n);
1190+
if (IS_ERR(unit))
1191+
return PTR_ERR(unit);
11741192

11751193
memcpy(unit->guid, &buffer[4], 16);
11761194
unit->extension.bNumControls = buffer[20];
@@ -1315,9 +1333,10 @@ static int uvc_gpio_parse(struct uvc_device *dev)
13151333
return dev_err_probe(&dev->intf->dev, irq,
13161334
"No IRQ for privacy GPIO\n");
13171335

1318-
unit = uvc_alloc_entity(UVC_EXT_GPIO_UNIT, UVC_EXT_GPIO_UNIT_ID, 0, 1);
1319-
if (!unit)
1320-
return -ENOMEM;
1336+
unit = uvc_alloc_new_entity(dev, UVC_EXT_GPIO_UNIT,
1337+
UVC_EXT_GPIO_UNIT_ID, 0, 1);
1338+
if (IS_ERR(unit))
1339+
return PTR_ERR(unit);
13211340

13221341
unit->gpio.gpio_privacy = gpio_privacy;
13231342
unit->gpio.irq = irq;

drivers/media/usb/uvc/uvcvideo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#define UVC_EXT_GPIO_UNIT 0x7ffe
4242
#define UVC_EXT_GPIO_UNIT_ID 0x100
4343

44+
#define UVC_INVALID_ENTITY_ID 0xffff
45+
4446
/* ------------------------------------------------------------------------
4547
* Driver specific constants.
4648
*/

0 commit comments

Comments
 (0)