]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitef1e7df902e0a3d4ca29b1f1165f2c9945d35409
treed0c0354920cd4b51812c51a68539c95e0bd71e90
parent661036bcc377846dbd14604f8066648de375672c
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