diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-amd756.c')
-rw-r--r-- | drivers/i2c/busses/i2c-amd756.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index 7490dc1771ae..573abe440842 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c | |||
@@ -334,6 +334,10 @@ static int __devinit amd756_probe(struct pci_dev *pdev, | |||
334 | int error; | 334 | int error; |
335 | u8 temp; | 335 | u8 temp; |
336 | 336 | ||
337 | /* driver_data might come from user-space, so check it */ | ||
338 | if (id->driver_data > ARRAY_SIZE(chipname)) | ||
339 | return -EINVAL; | ||
340 | |||
337 | if (amd756_ioport) { | 341 | if (amd756_ioport) { |
338 | dev_err(&pdev->dev, "Only one device supported " | 342 | dev_err(&pdev->dev, "Only one device supported " |
339 | "(you have a strange motherboard, btw)\n"); | 343 | "(you have a strange motherboard, btw)\n"); |
@@ -405,6 +409,7 @@ static struct pci_driver amd756_driver = { | |||
405 | .id_table = amd756_ids, | 409 | .id_table = amd756_ids, |
406 | .probe = amd756_probe, | 410 | .probe = amd756_probe, |
407 | .remove = __devexit_p(amd756_remove), | 411 | .remove = __devexit_p(amd756_remove), |
412 | .dynids.use_driver_data = 1, | ||
408 | }; | 413 | }; |
409 | 414 | ||
410 | static int __init amd756_init(void) | 415 | static int __init amd756_init(void) |