scsi: core: check for device state in __scsi_remove_target()
Hannes Reinecke authored
As it turned out device_get() doesn't use kref_get_unless_zero(), so we
will be always getting a device pointer.  Consequently, we need to check
for the device state in __scsi_remove_target() to avoid tripping over
deleted objects.

Fixes: fbce4d97

 ("scsi: fixup kernel warning during rmmod()")
Reported-by: default avatarJason Yan <yanaijie@huawei.com>
Signed-off-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
81b6c999
Name Last commit Last update
Documentation Merge tag 'ipmi-for-4.15' of git://github.com/cminyard/linux-ipmi
arch Merge tag 'pci-v4.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
block Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md
certs License cleanup: add SPDX GPL-2.0 license identifier to files with no license
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
drivers scsi: core: check for device state in __scsi_remove_target()
firmware License cleanup: add SPDX GPL-2.0 license identifier to files with no license
fs Merge tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
include scsi: libsas: align sata_device's rps_resp on a cacheline
init Merge tag 'pci-v4.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
ipc License cleanup: add SPDX GPL-2.0 license identifier to files with no license
kernel Merge branch 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
lib Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
mm Merge branch 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
net Merge tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
samples Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
scripts Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
security Merge tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
sound Merge tag 'sound-4.15-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
tools Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
usr initramfs: fix initramfs rebuilds w/ compression after disabling
virt Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.