Skip to content
Commit df621530 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron
Browse files

iio: adc: ti-ads1298: prevent divide by zero in ads1298_set_samp_freq()



The "val" variable comes from the user so we need to ensure that it's not
zero.  In fact, all negative values are invalid as well.  Add a check for
that.

Fixes: 00ef7708 ("iio: adc: ti-ads1298: Add driver")
Acked-by: default avatarMike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/c32c9087-86de-423b-8101-67b4a7f9d728@moroto.mountain


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent debabbb1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment