lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1329944133-28433-1-git-send-email-Julia.Lawall@lip6.fr>
Date:	Wed, 22 Feb 2012 21:55:33 +0100
From:	Julia Lawall <Julia.Lawall@...6.fr>
To:	jack_wang@...sh.com, dan.j.williams@...el.com
Cc:	kernel-janitors@...r.kernel.org, lindar_liu@...sh.com,
	"James E.J. Bottomley" <JBottomley@...allels.com>,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drivers/scsi/pm8001/pm8001_sas.c: move timer start

From: Julia Lawall <Julia.Lawall@...6.fr>

Move the add_timer below some instructions that do not seem to require a
timer and that in one case can fail, thus avoiding the need for a
corresponding del_timer.

Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>

---
I don't fully understand the code, and have not tested the change.  Think
of this patch as more of a question as to whether this is the right thing
to do.

 drivers/scsi/pm8001/pm8001_sas.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 6b5b4a2..72cbe6d 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -775,8 +775,6 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
 		task->slow_task->timer.data = (unsigned long)task;
 		task->slow_task->timer.function = pm8001_tmf_timedout;
 		task->slow_task->timer.expires = jiffies + PM8001_TASK_TIMEOUT * HZ;
-		add_timer(&task->slow_task->timer);
-
 		res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
 		if (res)
 			return res;
@@ -785,6 +783,8 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
 		ccb->ccb_tag = ccb_tag;
 		ccb->task = task;
 
+		add_timer(&task->slow_task->timer);
+
 		res = PM8001_CHIP_DISP->task_abort(pm8001_ha,
 			pm8001_dev, flag, task_tag, ccb_tag);
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ