From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
"Theodore Ts'o" <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Dave Jones <davej@redhat.com>,
Chuck Wolber <chuckw@quantumlinux.com>,
Chris Wedgwood <reviews@ml.cw.f00f.org>,
Michael Krufky <mkrufky@linuxtv.org>,
Chuck Ebbert <cebbert@redhat.com>,
Domenico Andreoli <cavokz@gmail.com>, Willy Tarreau <w@1wt.eu>,
Rodrigo Rubira Branco <rbranco@la.checkpoint.com>,
Jake Edge <jake@lwn.net>, Eugene Teo <eteo@redhat.com>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk, Wolfgang Ocker <weo@reccoware.de>,
David Brownell <dbrownell@users.sourceforge.net>
Subject: [patch 18/83] spi: avoid spidev crash when device is removed
Date: Thu, 11 Dec 2008 11:14:09 -0800 [thread overview]
Message-ID: <20081211191409.GR5894@kroah.com> (raw)
In-Reply-To: <20081211191014.GA5759@suse.de>
[-- Attachment #1: spi-avoid-spidev-crash-when-device-is-removed.patch --]
[-- Type: text/plain, Size: 2445 bytes --]
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wolfgang Ocker <weo@reccoware.de>
commit aaacf4bb51b243875b203e6ff73b5047636b4efa upstream.
I saw a kernel oops in spidev_remove() when a spidev device was registered
and I unloaded the SPI master driver:
Unable to handle kernel paging request for data at address 0x00000004
Faulting instruction address: 0xc01c0c50
Oops: Kernel access of bad area, sig: 11 [#1]
CDSPR
Modules linked in: spi_ppc4xx(-)
NIP: c01c0c50 LR: c01bf9e4 CTR: c01c0c34
REGS: cec89c30 TRAP: 0300 Not tainted (2.6.27.3izt)
MSR: 00021000 <ME> CR: 24000228 XER: 20000007
DEAR: 00000004, ESR: 00800000
TASK = cf889040[2070] 'rmmod' THREAD: cec88000
GPR00: 00000000 cec89ce0 cf889040 cec8e000 00000004 cec8e000 ffffffff 00000000
GPR08: 0000001c c0336380 00000000 c01c0c34 00000001 1001a338 100e0000 100df49c
GPR16: 100b54c0 100df49c 100ddd20 100f05a8 100b5340 100efd68 00000000 00000000
GPR24: 100ec008 100f0428 c0327788 c0327794 cec8e0ac cec8e000 c0336380 00000000
NIP [c01c0c50] spidev_remove+0x1c/0xe4
LR [c01bf9e4] spi_drv_remove+0x2c/0x3c
Call Trace:
[cec89d00] [c01bf9e4] spi_drv_remove+0x2c/0x3c
[cec89d10] [c01859a0] __device_release_driver+0x78/0xb4
[cec89d20] [c0185ab0] device_release_driver+0x28/0x44
[cec89d40] [c0184be8] bus_remove_device+0xac/0xd8
[cec89d60] [c0183094] device_del+0x100/0x194
[cec89d80] [c0183140] device_unregister+0x18/0x30
[cec89da0] [c01bf30c] __unregister+0x20/0x34
[cec89db0] [c0182778] device_for_each_child+0x38/0x74
[cec89de0] [c01bf2d0] spi_unregister_master+0x28/0x44
[cec89e00] [c01bfeac] spi_bitbang_stop+0x1c/0x58
[cec89e20] [d908a5e0] spi_ppc4xx_of_remove+0x24/0x7c [spi_ppc4xx]
[...]
IMHO a call to spi_set_drvdata() is missing in spidev_probe(). The patch
below helped.
Signed-off-by: Wolfgang Ocker <weo@reccoware.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/spi/spidev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -598,7 +598,9 @@ static int spidev_probe(struct spi_devic
}
mutex_unlock(&device_list_lock);
- if (status != 0)
+ if (status == 0)
+ spi_set_drvdata(spi, spidev);
+ else
kfree(spidev);
return status;
next prev parent reply other threads:[~2008-12-11 19:24 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081211190201.612240183@mini.kroah.org>
2008-12-11 19:10 ` [patch 00/83] 2.6.27.9-stable review Greg KH
2008-12-11 19:13 ` [patch 01/83] libata: improve phantom device detection Greg KH
2008-12-11 19:13 ` [patch 02/83] af_unix: netns: fix problem of return value Greg KH
2008-12-11 19:13 ` [patch 03/83] cxgb3: Fix kernel crash caused by uninitialized l2t_entry.arpq Greg KH
2008-12-11 21:12 ` Stefan Lippers-Hollmann
2008-12-11 23:41 ` Greg KH
2008-12-12 3:49 ` David Miller
2008-12-12 4:00 ` Greg KH
2008-12-12 5:11 ` David Miller
2008-12-11 19:13 ` [patch 04/83] niu: Fix readq implementation when architecture does not provide one Greg KH
2008-12-11 19:13 ` [patch 05/83] pppol2tp: Add missing sock_put() in pppol2tp_release() Greg KH
2008-12-11 19:13 ` [patch 06/83] udp: multicast packets need to check namespace Greg KH
2008-12-11 19:13 ` [patch 07/83] sparc64: Fix offset calculation in compute_size() Greg KH
2008-12-11 19:13 ` [patch 08/83] sparc64: Fix __copy_{to,from}_user_inatomic defines Greg KH
2008-12-11 19:13 ` [patch 09/83] sparc64: Fix PCI resource mapping on sparc64 Greg KH
2008-12-11 19:13 ` [patch 10/83] sparc64: Fix bug in PTRACE_SETFPREGS64 handling Greg KH
2008-12-11 19:13 ` [patch 11/83] sparc64: Fix VIS emulation bugs Greg KH
2008-12-11 19:13 ` [patch 12/83] sparc64: Sync FPU state in VIS emulation handler Greg KH
2008-12-11 19:13 ` [patch 13/83] Enforce a minimum SG_IO timeout Greg KH
2008-12-11 19:14 ` [patch 14/83] Fix a race condition in FASYNC handling Greg KH
2008-12-11 19:14 ` [patch 15/83] ACPI suspend: Blacklist boxes that require us to set SCI_EN directly on resume Greg KH
2008-12-11 19:14 ` [patch 16/83] jbd: fix error handling for checkpoint io Greg KH
2008-12-11 19:14 ` [patch 17/83] jbd: test BH_Write_EIO to detect errors on metadata buffers Greg KH
2008-12-11 19:14 ` Greg KH [this message]
2008-12-11 19:14 ` [patch 19/83] ATM: CVE-2008-5079: duplicate listen() on socket corrupts the vcc table Greg KH
2008-12-11 19:14 ` [patch 20/83] powerpc/mpic: Dont reset affinity for secondary MPIC on boot Greg KH
2008-12-11 19:14 ` [patch 21/83] Input: i8042 - add Thinkpad R31 to nomux list Greg KH
2008-12-11 19:14 ` [patch 22/83] Input: i8042 - add Blue FB5601 to noloop exception table Greg KH
2008-12-11 19:14 ` [patch 23/83] Input: i8042 - add Dell XPS M1530 to nomux list Greg KH
2008-12-11 19:14 ` [patch 24/83] Input: i8042 - add Compal Hel80 laptop to nomux blacklist Greg KH
2008-12-11 19:14 ` [patch 25/83] edac: fix enabling of polling cell module Greg KH
2008-12-11 19:14 ` [patch 26/83] USB: option: add Ericsson F3507g and Dell 5530 Greg KH
2008-12-11 19:14 ` [patch 27/83] USB: option.c remove duplicate device ids now supported in hso.c Greg KH
2008-12-11 19:14 ` [patch 28/83] USB: Option / AnyData new modem, same ID Greg KH
2008-12-11 19:14 ` [patch 29/83] USB: option: add Pantech cards Greg KH
2008-12-11 19:14 ` [patch 30/83] USB: add ZTE MF626 USB GSM modem entry Greg KH
2008-12-11 19:14 ` [patch 31/83] USB: support Huawei data card product IDs Greg KH
2008-12-11 19:14 ` [patch 32/83] USB: Add YISO u893 usb modem vendor and product IDs to option driver Greg KH
2008-12-11 19:14 ` [patch 33/83] USB: serial: add more Onda device ids " Greg KH
2008-12-11 19:14 ` [patch 34/83] USB: unusual-devs: support Huawei data card product IDs Greg KH
2008-12-11 19:14 ` [patch 35/83] USB: Unusual dev for Mio moov 330 gps Greg KH
2008-12-11 19:14 ` [patch 36/83] USB: Unusual dev for the "Kyocera / Contax SL300R T*" digital camera Greg KH
2008-12-11 19:14 ` [patch 37/83] USB: add Nikon D300 camera to unusual_devs Greg KH
2008-12-11 19:29 ` Chris Wedgwood
2008-12-11 19:51 ` Alan Stern
2008-12-11 23:42 ` Greg KH
2008-12-11 19:14 ` [patch 38/83] USB: unusual devs patch for Nokia 7610 Supernova Greg KH
2008-12-11 19:14 ` [patch 39/83] USB: storage: updates unusual_devs entry for the Nokia 6300 Greg KH
2008-12-11 19:15 ` [patch 40/83] USB: storage: update unusual_devs entries for Nokia 5300 and 5310 Greg KH
2008-12-11 19:15 ` [patch 41/83] USB: storage: unusual_devs entry for Mio C520-GPS Greg KH
2008-12-11 19:15 ` [patch 42/83] USB: usb-storage: unusual_devs entry for Nikon D2H Greg KH
2008-12-11 19:15 ` [patch 43/83] ALSA: HDA: hda_proc: Fix printf format specifier Greg KH
2008-12-11 19:15 ` [patch 44/83] ALSA: hda - Fix sound on NEC Versa S9100 Greg KH
2008-12-11 19:15 ` [patch 45/83] ALSA: hda: Add support for ECS/PC Chips boards with Sigmatel codecs Greg KH
2008-12-11 19:15 ` [patch 46/83] ALSA: hda - Fix ALC269 capture source Greg KH
2008-12-11 19:15 ` [patch 47/83] ALSA: hda - Add model for Toshiba L305 laptop Greg KH
2008-12-11 19:15 ` [patch 48/83] ALSA: hda: fixed hp_nid DAC for DELL_M6 Greg KH
2008-12-11 19:15 ` [patch 49/83] ALSA: HDA: patch_analog: Fix SPDIF output on AD1989B Greg KH
2008-12-11 19:15 ` [patch 50/83] ALSA: HDA: patch_analog: Quirk for Asus P5Q Premium/Pro boards Greg KH
2008-12-11 19:15 ` [patch 51/83] ALSA: hda: appletv support Greg KH
2008-12-11 19:15 ` [patch 52/83] ALSA: hda - Fix another ALC889A (rev 0x100101) Greg KH
2008-12-11 19:15 ` [patch 53/83] ALSA: hda - Add ALC887 support Greg KH
2008-12-11 19:15 ` [patch 54/83] ALSA: hda - Add support of ALC272 Greg KH
2008-12-11 19:15 ` [patch 55/83] ALSA: hda - Restore default pin configs for realtek codecs Greg KH
2008-12-11 19:15 ` [patch 56/83] ALSA: hda - Add another HP model for AD1884A Greg KH
2008-12-11 19:15 ` [patch 57/83] ALSA: hda - Add a quirk for another Acer Aspire (1025:0090) Greg KH
2008-12-11 19:15 ` [patch 58/83] ALSA: hda - Add a quirk for MEDION MD96630 Greg KH
2008-12-11 19:15 ` [patch 59/83] ALSA: hda - Add another HP model (6730s) for AD1884A Greg KH
2008-12-11 19:16 ` [patch 60/83] ALSA: hda - Make the HP EliteBook 8530p use AD1884A model laptop Greg KH
2008-12-11 19:16 ` [patch 61/83] ALSA: hda - Add a quirk for Dell Studio 15 Greg KH
2008-12-11 19:16 ` [patch 62/83] ALSA: hda - No Headphone as Line-out swich without line-outs Greg KH
2008-12-11 19:16 ` [patch 63/83] ALSA: hda - mark Dell studio 1535 quirk Greg KH
2008-12-11 19:16 ` [patch 64/83] ALSA: emu10k1 - Add more invert_shared_spdif flag to Audigy models Greg KH
2008-12-11 19:16 ` [patch 65/83] cxgb3 - fix race in EEH Greg KH
2008-12-11 19:16 ` [patch 66/83] cxgb3 - remove duplicate tests in lro Greg KH
2008-12-11 19:16 ` [patch 67/83] sched: fix a bug in sched domain degenerate Greg KH
2008-12-11 19:16 ` [patch 68/83] x86: HPET: convert WARN_ON to WARN_ON_ONCE Greg KH
2008-12-17 11:26 ` Matt Fleming
2008-12-17 11:33 ` Takashi Iwai
2008-12-17 12:03 ` Matt Fleming
2008-12-17 18:42 ` Greg KH
2008-12-17 19:51 ` Matt Fleming
2008-12-17 19:54 ` Greg KH
2008-12-18 11:37 ` Thomas Gleixner
2008-12-18 19:01 ` Greg KH
2008-12-11 19:16 ` [patch 69/83] x86, memory hotplug: remove wrong -1 in calling init_memory_mapping() Greg KH
2008-12-11 19:16 ` [patch 70/83] x86: remove debug code from arch_add_memory() Greg KH
2008-12-11 19:16 ` [patch 71/83] sched: CPU remove deadlock fix Greg KH
2008-12-11 19:16 ` [patch 72/83] PCI: stop leaking slot_name in pci_create_slot Greg KH
2008-12-11 19:16 ` [patch 73/83] PCIe: ASPM: Break out of endless loop waiting for PCI config bits to switch Greg KH
2008-12-11 19:16 ` [patch 74/83] uml: boot broken due to buffer overrun Greg KH
2008-12-11 19:16 ` [patch 75/83] pagemap: fix 32-bit pagemap regression Greg KH
2008-12-11 19:16 ` [patch 76/83] fix mapping_writably_mapped() Greg KH
2008-12-11 19:16 ` [patch 77/83] atv: hid quirk for appletv IR receiver Greg KH
2008-12-11 19:16 ` [patch 78/83] Allow recursion in binfmt_script and binfmt_misc Greg KH
2008-12-11 19:16 ` [patch 79/83] tracehook: exec double-reporting fix Greg KH
2008-12-11 19:16 ` [patch 80/83] powerpc/virtex5: Fix Virtex5 machine check handling Greg KH
2008-12-11 19:16 ` [patch 81/83] ACPI: delete OSI(Linux) DMI dmesg spam Greg KH
2008-12-11 19:16 ` [patch 82/83] cifs: fix a regression in cifs umount codepath Greg KH
2008-12-11 19:16 ` [patch 83/83] pnp: make the resource type an unsigned long Greg KH
2008-12-12 5:19 ` [stable] [patch 00/83] 2.6.27.9-stable review Greg KH
2008-12-12 5:21 ` [patch 84/83] powerpc: Use cpu_thread_in_core in smp_init for of_spin_map Greg KH
2008-12-12 5:24 ` [patch 85/83] XFS: Fix hang after disallowed rename across directory quota domains Greg KH
2008-12-13 9:29 ` [patch 00/83] 2.6.27.9-stable review François Valenduc
2008-12-16 23:25 ` Greg KH
2008-12-17 18:58 ` François Valenduc
2008-12-18 19:00 ` Greg KH
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=20081211191409.GR5894@kroah.com \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cavokz@gmail.com \
--cc=cebbert@redhat.com \
--cc=chuckw@quantumlinux.com \
--cc=davej@redhat.com \
--cc=dbrownell@users.sourceforge.net \
--cc=eteo@redhat.com \
--cc=jake@lwn.net \
--cc=jmforbes@linuxtx.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkrufky@linuxtv.org \
--cc=rbranco@la.checkpoint.com \
--cc=rdunlap@xenotime.net \
--cc=reviews@ml.cw.f00f.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=w@1wt.eu \
--cc=weo@reccoware.de \
--cc=zwane@arm.linux.org.uk \
/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