Showing error 1617

User: Jiri Slaby
Error type: Division by Zero
Error type description: The code tries to divide by zero
File location: drivers/media/common/tuners/tuner-simple.c
Line in file: 829
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 6b55009e1dc7c2a66c8f5fad67045f0536c9bbd8
Tools: Manual Work
Entered: 2012-08-14 09:51:55 UTC


Source:

 799                        default:
 800                                new_rf = 0;
 801                                break;
 802                        }
 803                simple_set_rf_input(fe, &buf[2], &buf[3], new_rf);
 804                break;
 805        }
 806        default:
 807                break;
 808        }
 809}
 810
 811static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
 812                                const struct dvb_frontend_parameters *params)
 813{
 814        /* This function returns the tuned frequency on success, 0 on error */
 815        struct tuner_simple_priv *priv = fe->tuner_priv;
 816        struct tunertype *tun = priv->tun;
 817        static struct tuner_params *t_params;
 818        u8 config, cb;
 819        u32 div;
 820        int ret;
 821        unsigned frequency = params->frequency / 62500;
 822
 823        t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL);
 824        ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb);
 825        if (ret < 0)
 826                return 0; /* failure */
 827
 828        div = ((frequency + t_params->iffreq) * 62500 + offset +
 829               tun->stepsize/2) / tun->stepsize;
 830
 831        buf[0] = div >> 8;
 832        buf[1] = div & 0xff;
 833        buf[2] = config;
 834        buf[3] = cb;
 835
 836        simple_set_dvb(fe, buf, params);
 837
 838        tuner_dbg("%s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n",
 839                  tun->name, div, buf[0], buf[1], buf[2], buf[3]);
Show full sources