LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Zahari Doychev <zahari.doychev@linux.com>
To: ming.lei@canonical.com, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org
Cc: zahari.doychev@linux.com
Subject: [PATCH v2] drivers: base: fw: fix ret value when loading fw
Date: Tue, 10 Mar 2015 10:45:40 +0100	[thread overview]
Message-ID: <1425980740-18919-1-git-send-email-zahari.doychev@linux.com> (raw)
In-Reply-To: <CACVXFVNPxeHkpfq7TP5H53Fs_0LMiYUJ7xEP6bZ287R8rbq7GA@mail.gmail.com>

When using the user mode helper to load firmwares the function _request_firmware
gets a positive return value from fw_load_from_user_helper and because of this
the firmware buffer is not assigned. This happens only when the return value
is zero. This patch fixes this problem in _request_firmware_load. When the
completion is ready the return value is set to zero.

Signed-off-by: Zahari Doychev <zahari.doychev@linux.com>
---

Changes from v1:
 - move handling of wait_for_completion_interruptible_timeout() return value

 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 6c5c9ed..4996541 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -913,6 +913,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 if (retval > 0) {
+		retval = 0;
 	}
 
 	if (is_fw_load_aborted(buf))
-- 
2.3.0


  reply	other threads:[~2015-03-10  9:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 15:49 [PATCH] fix loading of firmware with user mode helper Zahari Doychev
2015-03-09 15:49 ` [PATCH] drivers: base: fw: fix ret value when loading fw Zahari Doychev
2015-03-10  7:32   ` Ming Lei
2015-03-10  9:45     ` Zahari Doychev [this message]
2015-03-18  7:41       ` [PATCH v2] " Zahari Doychev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425980740-18919-1-git-send-email-zahari.doychev@linux.com \
    --to=zahari.doychev@linux.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --subject='Re: [PATCH v2] drivers: base: fw: fix ret value when loading fw' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).