]> git.baikalelectronics.ru Git - kernel.git/commit
iio: (max1363) Fix probe error path
authorGuenter Roeck <linux@roeck-us.net>
Mon, 24 Dec 2012 06:24:00 +0000 (06:24 +0000)
committerJonathan Cameron <jic23@kernel.org>
Thu, 27 Dec 2012 11:11:27 +0000 (11:11 +0000)
commita68bbd272b83545380260b1693a24310a05e03bb
tree388971fa73ac2dd804be94370d1a53b52fa5d23e
parent44d4c2b9059f4bbc4710439c3c5dc5c016d21c4d
iio: (max1363) Fix probe error path

Instantiating the driver with no available regulator results in:

[39711.686393] i2c i2c-7: new_device: Instantiated device max1139 at 0x35
[39711.688687] BUG: unable to handle kernel paging request at fffffffffffffe13
[39711.688734] IP: [<ffffffff813e835b>] regulator_disable+0x1b/0x80
[39711.688788] PGD 1c0e067 PUD 1c0f067 PMD 0
[39711.688835] Oops: 0000 [#1] SMP

Caused by bad probe error path. Fix it.

Driver should also not attempt to free the interrupt in its error path if
none was allocated. Fix that problem as well.

Finally, testing if the regulator was allocated is not necessary in the
remove function, since the probe function bails out if this is the case.
Remove that check.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/max1363.c