.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * uvc_entity.c -- USB Video Class driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2005-2011 |
---|
5 | 6 | * 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 | | - * |
---|
12 | 7 | */ |
---|
13 | 8 | |
---|
14 | 9 | #include <linux/kernel.h> |
---|
.. | .. |
---|
42 | 37 | continue; |
---|
43 | 38 | |
---|
44 | 39 | remote = uvc_entity_by_id(chain->dev, entity->baSourceID[i]); |
---|
45 | | - if (remote == NULL) |
---|
| 40 | + if (remote == NULL || remote->num_pads == 0) |
---|
46 | 41 | return -EINVAL; |
---|
47 | 42 | |
---|
48 | 43 | source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING) |
---|
.. | .. |
---|
81 | 76 | u32 function; |
---|
82 | 77 | |
---|
83 | 78 | v4l2_subdev_init(&entity->subdev, &uvc_subdev_ops); |
---|
84 | | - strlcpy(entity->subdev.name, entity->name, |
---|
| 79 | + strscpy(entity->subdev.name, entity->name, |
---|
85 | 80 | sizeof(entity->subdev.name)); |
---|
86 | 81 | |
---|
87 | 82 | switch (UVC_ENTITY_TYPE(entity)) { |
---|