linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Mathias Duckeck <m.duckeck@kunbus.de>,
	Phil Elwell <phil@raspberrypi.org>,
	Oskar Andero <oskar.andero@gmail.com>,
	Andrea Galbusera <gizero@gmail.com>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	Manfred Schlaegl <manfred.schlaegl@gmx.at>,
	Michael Welling <mwelling@ieee.org>,
	Soeren Andersen <san@rosetechnology.dk>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/6] iio: adc: mcp320x: Fix oops on module unload
Date: Sun, 3 Sep 2017 14:41:39 +0100	[thread overview]
Message-ID: <20170903144139.51ae5ac1@archlinux> (raw)
In-Reply-To: <c3942be5a25903744b90a014103a50f252d7ff43.1503407738.git.lukas@wunner.de>

On Tue, 22 Aug 2017 15:33:00 +0200
Lukas Wunner <lukas@wunner.de> wrote:

> The driver calls spi_get_drvdata() in its ->remove hook even though it
> has never called spi_set_drvdata().  Stack trace for posterity:
> 
> Unable to handle kernel NULL pointer dereference at virtual address 00000220
> Internal error: Oops: 5 [#1] SMP ARM
> [<8072f564>] (mutex_lock) from [<7f1400d0>] (iio_device_unregister+0x24/0x7c [industrialio])
> [<7f1400d0>] (iio_device_unregister [industrialio]) from [<7f15e020>] (mcp320x_remove+0x20/0x30 [mcp320x])
> [<7f15e020>] (mcp320x_remove [mcp320x]) from [<8055a8cc>] (spi_drv_remove+0x2c/0x44)
> [<8055a8cc>] (spi_drv_remove) from [<805087bc>] (__device_release_driver+0x98/0x134)
> [<805087bc>] (__device_release_driver) from [<80509180>] (driver_detach+0xdc/0xe0)
> [<80509180>] (driver_detach) from [<8050823c>] (bus_remove_driver+0x5c/0xb0)
> [<8050823c>] (bus_remove_driver) from [<80509ab0>] (driver_unregister+0x38/0x58)
> [<80509ab0>] (driver_unregister) from [<7f15e69c>] (mcp320x_driver_exit+0x14/0x1c [mcp320x])
> [<7f15e69c>] (mcp320x_driver_exit [mcp320x]) from [<801a78d0>] (SyS_delete_module+0x184/0x1d0)
> [<801a78d0>] (SyS_delete_module) from [<80108100>] (ret_fast_syscall+0x0/0x1c)
> 
> Fixes: f5ce4a7a9291 ("iio: adc: add driver for MCP3204/08 12-bit ADC")
> Cc: Oskar Andero <oskar.andero@gmail.com>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Applied to the fixes-togreg branch of iio.git and marked for stable.

This won't now hit until after the merge window, but it should be fairly
soon after that.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/mcp320x.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/adc/mcp320x.c b/drivers/iio/adc/mcp320x.c
> index 634717ae12f3..45d043c9a888 100644
> --- a/drivers/iio/adc/mcp320x.c
> +++ b/drivers/iio/adc/mcp320x.c
> @@ -312,6 +312,7 @@ static int mcp320x_probe(struct spi_device *spi)
>  	indio_dev->name = spi_get_device_id(spi)->name;
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  	indio_dev->info = &mcp320x_info;
> +	spi_set_drvdata(spi, indio_dev);
>  
>  	chip_info = &mcp320x_chip_infos[spi_get_device_id(spi)->driver_data];
>  	indio_dev->channels = chip_info->channels;


  reply	other threads:[~2017-09-03 13:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 13:33 [PATCH 0/6] IIO driver for MCP3550/1/3 Lukas Wunner
2017-08-22 13:33 ` [PATCH 5/6] dt-bindings: iio: adc: mcp320x: Update for mcp3550/1/3 Lukas Wunner
2017-08-25 19:59   ` Rob Herring
2017-08-27 15:34     ` Lukas Wunner
2017-08-29  7:21       ` Adriana Reus
2017-09-03 13:37         ` Jonathan Cameron
2017-09-03 18:20           ` Lukas Wunner
2017-09-04 12:36             ` Jonathan Cameron
2017-09-04 17:22           ` Mark Brown
2017-09-10 13:36             ` Jonathan Cameron
2017-09-05 18:49       ` Rob Herring
2017-08-22 13:33 ` [PATCH 1/6] iio: adc: mcp320x: Fix oops on module unload Lukas Wunner
2017-09-03 13:41   ` Jonathan Cameron [this message]
2017-08-22 13:33 ` [PATCH 2/6] iio: adc: mcp320x: Fix readout of negative voltages Lukas Wunner
2017-09-03 13:44   ` Jonathan Cameron
2017-08-22 13:33 ` [PATCH 4/6] iio: adc: mcp320x: Drop unnecessary of_device_id attributes Lukas Wunner
2017-09-03 13:59   ` Jonathan Cameron
2017-08-22 13:33 ` [PATCH 3/6] iio: adc: mcp320x: Speed up readout of single-channel ADCs Lukas Wunner
2017-09-03 13:48   ` Jonathan Cameron
2017-08-22 13:33 ` [PATCH 6/6] iio: adc: mcp320x: Add support for mcp3550/1/3 Lukas Wunner
2017-09-03 14:22   ` Jonathan Cameron
2017-09-07  6:44     ` Lukas Wunner
2017-09-10 13:40       ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170903144139.51ae5ac1@archlinux \
    --to=jic23@kernel.org \
    --cc=akinobu.mita@gmail.com \
    --cc=gizero@gmail.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=m.duckeck@kunbus.de \
    --cc=manfred.schlaegl@gmx.at \
    --cc=mwelling@ieee.org \
    --cc=oskar.andero@gmail.com \
    --cc=phil@raspberrypi.org \
    --cc=pmeerw@pmeerw.net \
    --cc=san@rosetechnology.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).