summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorMark Lord2008-06-19 03:57:42 +0200
committerJeff Garzik2008-07-04 15:07:12 +0200
commitc7843e8f565f624b0cff7cad1370fad4cb84dfbc (patch)
tree0f8f663485fc6f7bd248d86dea7e69cd3c8b6324 /drivers/ata
parentlibata-sff: improve HSM violation reporting (diff)
downloadkernel-qcow2-linux-c7843e8f565f624b0cff7cad1370fad4cb84dfbc.tar.gz
kernel-qcow2-linux-c7843e8f565f624b0cff7cad1370fad4cb84dfbc.tar.xz
kernel-qcow2-linux-c7843e8f565f624b0cff7cad1370fad4cb84dfbc.zip
sata_mv: safer logic for limit_warnings
There is a miniscule chance that two separate host controllers might be in sata_mv at the same time and manage to decrement the static limit_warnings variable below zero. Fix the comparison to deal with it. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/sata_mv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 28092bc50146..ad169ffbc4cb 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1607,7 +1607,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
* Much of the time, this could just work regardless.
* So for now, just log the incident, and allow the attempt.
*/
- if (limit_warnings && (qc->nbytes / qc->sect_size) > 1) {
+ if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) {
--limit_warnings;
ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME
": attempting PIO w/multiple DRQ: "