hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/media/usb/dvb-usb-v2/ce6230.c
....@@ -1,18 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Intel CE6230 DVB USB driver
34 *
45 * Copyright (C) 2009 Antti Palosaari <crope@iki.fi>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
166 */
177
188 #include "ce6230.h"
....@@ -111,6 +101,10 @@
111101 if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {
112102 if (msg[i].addr ==
113103 ce6230_zl10353_config.demod_address) {
104
+ if (msg[i].len < 1) {
105
+ i = -EOPNOTSUPP;
106
+ break;
107
+ }
114108 req.cmd = DEMOD_READ;
115109 req.value = msg[i].addr >> 1;
116110 req.index = msg[i].buf[0];
....@@ -127,6 +121,10 @@
127121 } else {
128122 if (msg[i].addr ==
129123 ce6230_zl10353_config.demod_address) {
124
+ if (msg[i].len < 1) {
125
+ i = -EOPNOTSUPP;
126
+ break;
127
+ }
130128 req.cmd = DEMOD_WRITE;
131129 req.value = msg[i].addr >> 1;
132130 req.index = msg[i].buf[0];