From: Chris Boot Date: Mon, 22 Aug 2011 20:38:38 +0000 (+0100) Subject: firewire: sbp2: fix panic after rmmod with slow targets X-Git-Tag: v3.1-rc4~2^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0278ccd9d53e07c4e699432b2fed9de6c56f506c;p=pandora-kernel.git firewire: sbp2: fix panic after rmmod with slow targets If firewire-sbp2 starts a login to a target that doesn't complete ORBs in a timely manner (and has to retry the login), and the module is removed before the operation times out, you end up with a null-pointer dereference and a kernel panic. [SR: This happens because sbp2_target_get/put() do not maintain module references. scsi_device_get/put() do, but at occasions like Chris describes one, nobody holds a reference to an SBP-2 sdev.] This patch cancels pending work for each unit in sbp2_remove(), which hopefully means there are no extra references around that prevent us from unloading. This fixes my crash. Signed-off-by: Chris Boot Signed-off-by: Stefan Richter --- Reading git-diff-tree failed