[media] m88ts2022: return the err code in its probe function when error occurs
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>
This commit is contained in:
parent
070e66611d
commit
4954578efb
@ -488,6 +488,7 @@ static int m88ts2022_probe(struct i2c_client *client,
|
|||||||
case 0x83:
|
case 0x83:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
ret = -ENODEV;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,6 +506,7 @@ static int m88ts2022_probe(struct i2c_client *client,
|
|||||||
u8tmp = 0x6c;
|
u8tmp = 0x6c;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user