lkml.org 
[lkml]   [2015]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 2/3] firmware_loader: fix positive return value being treat as error return
Date
From: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>

Due to wait_for_completion_interruptible_timeout() will return
its remaining timeout jiffies value if timeout does not happen,
the error check code "if (ret)" will treat that as error return.
So, fixing the issue by re-assigning back a 'Zero' to the return
value when the wait is completed without timeout.

Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@intel.com>
---
drivers/base/firmware_class.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index e03235d..b38975d 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -923,6 +923,8 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
mutex_lock(&fw_lock);
fw_load_abort(fw_priv);
mutex_unlock(&fw_lock);
+ } else {
+ retval = 0;
}

if (is_fw_load_aborted(buf))
--
1.7.9.5


\
 
 \ /
  Last update: 2015-04-10 14:21    [W:0.057 / U:4.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site