hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/usb/uvc/uvc_entity.c
....@@ -1,14 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * uvc_entity.c -- USB Video Class driver
34 *
45 * Copyright (C) 2005-2011
56 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
127 */
138
149 #include <linux/kernel.h>
....@@ -42,7 +37,7 @@
4237 continue;
4338
4439 remote = uvc_entity_by_id(chain->dev, entity->baSourceID[i]);
45
- if (remote == NULL)
40
+ if (remote == NULL || remote->num_pads == 0)
4641 return -EINVAL;
4742
4843 source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
....@@ -81,7 +76,7 @@
8176 u32 function;
8277
8378 v4l2_subdev_init(&entity->subdev, &uvc_subdev_ops);
84
- strlcpy(entity->subdev.name, entity->name,
79
+ strscpy(entity->subdev.name, entity->name,
8580 sizeof(entity->subdev.name));
8681
8782 switch (UVC_ENTITY_TYPE(entity)) {