X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fi2c%2Fbusses%2Fi2c-amd756.c;h=43508d61eb7cf455c03fee1c82d4dfe501fbd260;hb=a926c063738f31c8c8b5c2b883812a40e7868072;hp=7490dc1771ae11f4e1335d53aff103549f0515c5;hpb=b0138a6cb7923a997d278b47c176778534d1095b;p=pandora-kernel.git diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index 7490dc1771ae..43508d61eb7c 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c @@ -290,7 +290,7 @@ static u32 amd756_func(struct i2c_adapter *adapter) { return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | - I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_PROC_CALL; + I2C_FUNC_SMBUS_BLOCK_DATA; } static const struct i2c_algorithm smbus_algorithm = { @@ -334,6 +334,10 @@ static int __devinit amd756_probe(struct pci_dev *pdev, int error; u8 temp; + /* driver_data might come from user-space, so check it */ + if (id->driver_data >= ARRAY_SIZE(chipname)) + return -EINVAL; + if (amd756_ioport) { dev_err(&pdev->dev, "Only one device supported " "(you have a strange motherboard, btw)\n"); @@ -405,6 +409,7 @@ static struct pci_driver amd756_driver = { .id_table = amd756_ids, .probe = amd756_probe, .remove = __devexit_p(amd756_remove), + .dynids.use_driver_data = 1, }; static int __init amd756_init(void)