| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Intel CE6230 DVB USB driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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 | | - * |
|---|
| 16 | 6 | */ |
|---|
| 17 | 7 | |
|---|
| 18 | 8 | #include "ce6230.h" |
|---|
| .. | .. |
|---|
| 111 | 101 | if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) { |
|---|
| 112 | 102 | if (msg[i].addr == |
|---|
| 113 | 103 | ce6230_zl10353_config.demod_address) { |
|---|
| 104 | + if (msg[i].len < 1) { |
|---|
| 105 | + i = -EOPNOTSUPP; |
|---|
| 106 | + break; |
|---|
| 107 | + } |
|---|
| 114 | 108 | req.cmd = DEMOD_READ; |
|---|
| 115 | 109 | req.value = msg[i].addr >> 1; |
|---|
| 116 | 110 | req.index = msg[i].buf[0]; |
|---|
| .. | .. |
|---|
| 127 | 121 | } else { |
|---|
| 128 | 122 | if (msg[i].addr == |
|---|
| 129 | 123 | ce6230_zl10353_config.demod_address) { |
|---|
| 124 | + if (msg[i].len < 1) { |
|---|
| 125 | + i = -EOPNOTSUPP; |
|---|
| 126 | + break; |
|---|
| 127 | + } |
|---|
| 130 | 128 | req.cmd = DEMOD_WRITE; |
|---|
| 131 | 129 | req.value = msg[i].addr >> 1; |
|---|
| 132 | 130 | req.index = msg[i].buf[0]; |
|---|