LKML Archive on
help / color / mirror / Atom feed
From: Zahari Doychev <>
Subject: [PATCH] drivers: base: fw: fix ret value when loading fw
Date: Mon,  9 Mar 2015 16:49:52 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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 <>
 drivers/base/firmware_class.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 6c5c9ed..9642e5f 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -920,6 +920,10 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
 	else if (!buf->data)
 		retval = -ENOMEM;
+	/* wait for completion was successful so return ok */
+	if (retval > 0)
+		retval = 0;
 	device_remove_file(f_dev, &dev_attr_loading);
 	device_remove_bin_file(f_dev, &firmware_attr_data);

  reply	other threads:[~2015-03-09 15:59 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 ` Zahari Doychev [this message]
2015-03-10  7:32   ` [PATCH] drivers: base: fw: fix ret value when loading fw Ming Lei
2015-03-10  9:45     ` [PATCH v2] " Zahari Doychev
2015-03-18  7:41       ` 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:

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

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH] drivers: base: fw: fix ret value when loading fw' \

* 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).