diff options
Diffstat (limited to 'drivers/spi/spi_mpc83xx.c')
-rw-r--r-- | drivers/spi/spi_mpc83xx.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index ab7ee445d8b2..ac0e3e4b3c54 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c | |||
@@ -312,11 +312,20 @@ static int mpc83xx_spi_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
312 | if (t->bits_per_word) | 312 | if (t->bits_per_word) |
313 | bits_per_word = t->bits_per_word; | 313 | bits_per_word = t->bits_per_word; |
314 | len = t->len; | 314 | len = t->len; |
315 | if (bits_per_word > 8) | 315 | if (bits_per_word > 8) { |
316 | /* invalid length? */ | ||
317 | if (len & 1) | ||
318 | return -EINVAL; | ||
316 | len /= 2; | 319 | len /= 2; |
317 | if (bits_per_word > 16) | 320 | } |
321 | if (bits_per_word > 16) { | ||
322 | /* invalid length? */ | ||
323 | if (len & 1) | ||
324 | return -EINVAL; | ||
318 | len /= 2; | 325 | len /= 2; |
326 | } | ||
319 | mpc83xx_spi->count = len; | 327 | mpc83xx_spi->count = len; |
328 | |||
320 | INIT_COMPLETION(mpc83xx_spi->done); | 329 | INIT_COMPLETION(mpc83xx_spi->done); |
321 | 330 | ||
322 | /* enable rx ints */ | 331 | /* enable rx ints */ |