]> git.karo-electronics.de Git - karo-tx-linux.git/commit
libsas: fix sas_get_port_device regression
authorDan Williams <dan.j.williams@intel.com>
Mon, 12 Mar 2012 18:38:26 +0000 (11:38 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 11 Apr 2012 02:15:22 +0000 (19:15 -0700)
commit6be254f019fd8dadc63cc63ded75d2422e2057b7
tree758dc0277beea0e8e9d277d2dc23596102f82a5f
parent71cb71d183256fbe77f35558606989c8f47c4ff0
libsas: fix sas_get_port_device regression

Commit 899fcf4 "[SCSI] libsas: set attached device type and target
protocols for local phys" setup 'phy' to be dereferenced after
list_for_each_entry(phy, &port->phy_list, port_phy_el) (i.e. phy ==
&port->phy_list) resulting in reports like:

  BUG: unable to handle kernel NULL pointer dereference at 00000000000002b0
  IP: [<ffffffffa00ce948>] sas_discover_domain+0x29e/0x4fb [libsas]

...fix by deferring sas_phy_set_target() to the end of
sas_get_port_device().

Reported-by: Tom Jackson <thomas.p.jackson@intel.com>
Tested-by: Tom Jackson <thomas.p.jackson@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/scsi/libsas/sas_discover.c