[media] m88ts2022: return the err code in its probe function when error occurs
authornibble.max <nibble.max@gmail.com>
Thu, 23 Oct 2014 13:36:49 +0000 (10:36 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 3 Nov 2014 13:53:00 +0000 (11:53 -0200)
if "chip_id" is wrong or "dev->cfg.clock_out" is invalid, the i2c model is still loaded.
It will cause "kernel NULL pointer dereference" oops when the i2c model remove.
returning the err code will prevent the i2c model load.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/tuners/m88ts2022.c

index caa542346891f630074ec26d1aa11d046f85e261..066e5431da930f201d9fe4b910735b6d88d4df1d 100644 (file)
@@ -488,6 +488,7 @@ static int m88ts2022_probe(struct i2c_client *client,
        case 0x83:
                break;
        default:
+               ret = -ENODEV;
                goto err;
        }
 
@@ -505,6 +506,7 @@ static int m88ts2022_probe(struct i2c_client *client,
                u8tmp = 0x6c;
                break;
        default:
+               ret = -EINVAL;
                goto err;
        }