libata: unbreak TPM filtering by reorganizing ata_scsi_pass_thru()
authorTejun Heo <tj@kernel.org>
Thu, 3 Sep 2009 07:08:11 +0000 (16:08 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 9 Sep 2009 01:17:43 +0000 (21:17 -0400)
commitbd30add88cea831dfb854d564478f09ee66206b5
treed0c0354920cd4b51812c51a68539c95e0bd71e90
parent72fee3823d2938fa98f2f3113301f46803f4c711
libata: unbreak TPM filtering by reorganizing ata_scsi_pass_thru()

ata_scsi_pass_thru() was checking for input sanity and disallowed
commands while initializaing qc from scmd.  TPM filtering was added
right after protocol check at which point tf wasn't initialized
properly.  This means that TPM filtering has never really worked.

This patch fixes the bug by reorganizing ata_scsi_pass_thru() such
that qc is fully initialized before checking for invalid conditions
which is way less error prone.

Discovered while Thilo-Alexander Ginkel was trying debug patches for
bko#13416.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Thilo-Alexander Ginkel <thilo@ginkel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-scsi.c