drxk: Does not unlock mutex if sanity check failed in scu_command()
[pandora-kernel.git] / drivers / media / dvb / frontends / drxk_hard.c
index 41b0838..a1f5e3d 100644 (file)
@@ -1523,8 +1523,10 @@ static int scu_command(struct drxk_state *state,
        dprintk(1, "\n");
 
        if ((cmd == 0) || ((parameterLen > 0) && (parameter == NULL)) ||
-           ((resultLen > 0) && (result == NULL)))
-               goto error;
+           ((resultLen > 0) && (result == NULL))) {
+               printk(KERN_ERR "drxk: Error %d on %s\n", status, __func__);
+               return status;
+       }
 
        mutex_lock(&state->mutex);
 
@@ -6211,6 +6213,14 @@ static int drxk_set_parameters(struct dvb_frontend *fe,
        u32 IF;
 
        dprintk(1, "\n");
+
+       if (!fe->ops.tuner_ops.get_if_frequency) {
+               printk(KERN_ERR
+                      "drxk: Error: get_if_frequency() not defined at tuner. Can't work without it!\n");
+               return -EINVAL;
+       }
+
+
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 1);
        if (fe->ops.tuner_ops.set_params)
@@ -6218,7 +6228,7 @@ static int drxk_set_parameters(struct dvb_frontend *fe,
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 0);
        state->param = *p;
-       fe->ops.tuner_ops.get_frequency(fe, &IF);
+       fe->ops.tuner_ops.get_if_frequency(fe, &IF);
        Start(state, 0, IF);
 
        /* printk(KERN_DEBUG "drxk: %s IF=%d done\n", __func__, IF); */