From: Lars-Peter Clausen Date: Wed, 12 Sep 2012 11:06:00 +0000 (+0100) Subject: staging:iio:dummy: Fix potential NULL pointer dereference X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~75^2~50^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fff22743640637c2b61473d3cc8d7dc2215984f;p=pandora-kernel.git staging:iio:dummy: Fix potential NULL pointer dereference If the config contains CONFIG_IIO_BUFFER=y and CONFIG_IIO_SIMPLE_DUMMY_BUFFER=n iio_simple_dummy_configure_buffer() is stubbed out and iio_buffer_register() is not. As a result we try to register a buffer which has not been configured. This will causes a NULL pointer deref in iio_buffer_register. To solve this issue move the iio_buffer_register() call to iio_simple_dummy_configure_buffer(), so it will only be called if iio_simple_dummy_configure_buffer() has been called. Reported-by: Fengguang Wu Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron --- Reading git-diff-tree failed