Commit ceb1edc2 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

staging: most: i2c: prevent division by zero

This prevents division by zero scan_rate.

The zero scan_rate does not need any special action as it actually means
"never poll again".
Signed-off-by: default avatarAndrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 071e5069
...@@ -252,7 +252,7 @@ static void pending_rx_work(struct work_struct *work) ...@@ -252,7 +252,7 @@ static void pending_rx_work(struct work_struct *work)
do_rx_work(dev); do_rx_work(dev);
if (dev->polling_mode) { if (dev->polling_mode) {
if (dev->is_open[CH_RX]) if (dev->is_open[CH_RX] && scan_rate)
schedule_delayed_work(&dev->rx.dwork, schedule_delayed_work(&dev->rx.dwork,
msecs_to_jiffies(MSEC_PER_SEC msecs_to_jiffies(MSEC_PER_SEC
/ scan_rate)); / scan_rate));
......
Markdown is supported
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