diff options
-rw-r--r-- | drivers/media/cec/cec-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c index ea3eccfdba15..b0c87f9ea08f 100644 --- a/drivers/media/cec/cec-core.c +++ b/drivers/media/cec/cec-core.c | |||
@@ -209,14 +209,14 @@ static ssize_t cec_error_inj_write(struct file *file, | |||
209 | if (IS_ERR(buf)) | 209 | if (IS_ERR(buf)) |
210 | return PTR_ERR(buf); | 210 | return PTR_ERR(buf); |
211 | p = buf; | 211 | p = buf; |
212 | while (p && *p && count >= 0) { | 212 | while (p && *p) { |
213 | p = skip_spaces(p); | 213 | p = skip_spaces(p); |
214 | line = strsep(&p, "\n"); | 214 | line = strsep(&p, "\n"); |
215 | if (!*line || *line == '#') | 215 | if (!*line || *line == '#') |
216 | continue; | 216 | continue; |
217 | if (!adap->ops->error_inj_parse_line(adap, line)) { | 217 | if (!adap->ops->error_inj_parse_line(adap, line)) { |
218 | count = -EINVAL; | 218 | kfree(buf); |
219 | break; | 219 | return -EINVAL; |
220 | } | 220 | } |
221 | } | 221 | } |
222 | kfree(buf); | 222 | kfree(buf); |