ahci: fix Null pointer dereference in achi_host_active()
authorXiaotian Feng <xtfeng@gmail.com>
Tue, 23 Jul 2013 03:54:10 +0000 (11:54 +0800)
committerTejun Heo <tj@kernel.org>
Tue, 23 Jul 2013 14:25:32 +0000 (10:25 -0400)
commitc91bc6ccd13254826fdfceddba0f3b5e308aa93e
tree5981ac59d9a7d706a397a568cf4e447bc318b135
parentbb9696192826a7d9279caf872e95b41bc26c7eff
ahci: fix Null pointer dereference in achi_host_active()

commit b29900e6 (AHCI: Make distinct names for ports in /proc/interrupts)
introuded a regression, which resulted Null pointer dereference for achi
host with dummy ports. For ahci ports, when the port is dummy port, its
private_data will be NULL, as ata_dummy_port_ops doesn't support ->port_start.

changes in v2: use pp to check dummy ports, update comments

Reported-and-tested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Xiaotian Feng <xtfeng@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Alexander Gordeev <agordeev@redhat.com>
Cc: linux-ide@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
drivers/ata/ahci.c