From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:58544 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753773AbdEESds (ORCPT ); Fri, 5 May 2017 14:33:48 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Romer , Arnd Bergmann Subject: [PATCH 3.18 60/68] staging: unisys: correctly handle return value from queue_delayed_work() Date: Fri, 5 May 2017 11:32:45 -0700 Message-Id: <20170505183214.967826601@linuxfoundation.org> In-Reply-To: <20170505183212.587141964@linuxfoundation.org> References: <20170505183212.587141964@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: stable-owner@vger.kernel.org List-ID: 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Romer commit f84bd6267d623b49f196d54ba9edc41ff1c4d5e3 upstream. Properly handle the return value from queue_delayed_work() - it's a bool, not an int, so using a less than comparison isn't appropriate. This mistake was found by David Binderman . [arnd: the fix is from 4.4 but needed some minor fixup to adapt to context changes] Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman Signed-off-by: Arnd Bergmann --- drivers/staging/unisys/visorutil/periodic_work.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/staging/unisys/visorutil/periodic_work.c +++ b/drivers/staging/unisys/visorutil/periodic_work.c @@ -98,8 +98,8 @@ BOOL visor_periodic_work_nextperiod(stru pw->want_to_stop = FALSE; rc = TRUE; /* yes, TRUE; see visor_periodic_work_stop() */ goto unlock; - } else if (queue_delayed_work(pw->workqueue, &pw->work, - pw->jiffy_interval) < 0) { + } else if (!queue_delayed_work(pw->workqueue, &pw->work, + pw->jiffy_interval)) { ERRDEV(pw->devnam, "queue_delayed_work failed!"); pw->is_scheduled = FALSE; rc = FALSE; @@ -134,8 +134,8 @@ BOOL visor_periodic_work_start(struct pe goto unlock; } INIT_DELAYED_WORK(&pw->work, &periodic_work_func); - if (queue_delayed_work(pw->workqueue, &pw->work, - pw->jiffy_interval) < 0) { + if (!queue_delayed_work(pw->workqueue, &pw->work, + pw->jiffy_interval)) { ERRDEV(pw->devnam, "%s queue_delayed_work failed!", __func__); rc = FALSE; goto unlock;