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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 23 Aug 2013 16:11:01 +0100
From:	Rupesh Gujare <rupesh.gujare@...el.com>
To:	<devel@...uxdriverproject.org>
CC:	<sergei.shtylyov@...entembedded.com>, <dan.carpenter@...cle.com>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<gregkh@...uxfoundation.org>
Subject: [PATCH 2/3] staging: ozwpan: Fix wrong error check.

schedule_work() returns true if succeeded & false on failure,
error check was doing exactly reverse.
Also removes extra variable.

Signed-off-by: Rupesh Gujare <rupesh.gujare@...el.com>
---
 drivers/staging/ozwpan/ozpd.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index 5d24af3..d39a3df 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -261,17 +261,13 @@ void oz_pd_free(struct work_struct *work)
  */
 void oz_pd_destroy(struct oz_pd *pd)
 {
-	int ret;
-
 	if (hrtimer_active(&pd->timeout))
 		hrtimer_cancel(&pd->timeout);
 	if (hrtimer_active(&pd->heartbeat))
 		hrtimer_cancel(&pd->heartbeat);
 
 	INIT_WORK(&pd->workitem, oz_pd_free);
-	ret = schedule_work(&pd->workitem);
-
-	if (ret)
+	if (!schedule_work(&pd->workitem))
 		oz_pd_dbg(pd, ON, "failed to schedule workitem\n");
 }
 
-- 
1.7.9.5

--
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