OSDN Git Service

staging: iio: ad9832: allocate data before using
authorArnd Bergmann <arnd@arndb.de>
Tue, 8 Nov 2016 14:00:49 +0000 (15:00 +0100)
committerJonathan Cameron <jic23@kernel.org>
Tue, 8 Nov 2016 20:22:32 +0000 (20:22 +0000)
commit6826fdbd2e207f8107e65c5a372ac616e7af11b4
treeb56a9fae8d33549e5d85f08dd4fa658dea5791ca
parent993403b9798123db4eb9d9bba1ab41f388dc1ea1
staging: iio: ad9832: allocate data before using

The regulator changes assigned data to an uninitialized pointer:

drivers/staging/iio/frequency/ad9832.c: In function 'ad9832_probe':
drivers/staging/iio/frequency/ad9832.c:214:11: error: 'st' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This moves the allocation of the 'st' structure before its first
use, as it should have been.

Fixes: 43a07e48af44 ("staging: iio: ad9832: clean-up regulator 'reg'")
Fixes: a98461d79ba5 ("staging: iio: ad9832: add DVDD regulator")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/frequency/ad9832.c