diff --git a/drivers/staging/iio/iio_simple_dummy.c b/drivers/staging/iio/iio_simple_dummy.c index fd334a03a49a3ead72e5c9e7d68e64ac0391d658..bf78e6f0311ff3699818bd42ef055e21e4b2710a 100644 --- a/drivers/staging/iio/iio_simple_dummy.c +++ b/drivers/staging/iio/iio_simple_dummy.c @@ -550,6 +550,7 @@ static int iio_dummy_remove(int index) static __init int iio_dummy_init(void) { int i, ret; + if (instances > 10) { instances = 1; return -EINVAL; @@ -577,6 +578,7 @@ module_init(iio_dummy_init); static __exit void iio_dummy_exit(void) { int i; + for (i = 0; i < instances; i++) iio_dummy_remove(i); kfree(iio_dummy_devs);