]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
libata: Fix a potential race condition in ata_scsi_park_show()
authorElias Oltmanns <eo@nebensachen.de>
Mon, 3 Nov 2008 10:01:08 +0000 (19:01 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 4 Nov 2008 06:08:24 +0000 (01:08 -0500)
commita464189de350b050aa8f334bd4cc53ed406e56dd
treed4acc5c1f65eca5522bbd28ae2702e54a1f8db0a
parent3c324283e6cdb79210cf7975c3e40d3ba3e672b2
libata: Fix a potential race condition in ata_scsi_park_show()

Peter Moulder has pointed out that there is a slight chance that a
negative value might be passed to jiffies_to_msecs() in
ata_scsi_park_show(). This is fixed by saving the value of jiffies in a
local variable, thus also reducing code since the volatile variable
jiffies is accessed only once.

Signed-off-by: Elias Oltmanns <eo@nebensachen.de>
Signed-off-by: Tejun Heo <tj.kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-scsi.c