firmware loader: Fix _request_firmware_load() return val for fw load abort
authorShuah Khan <shuah.kh@samsung.com>
Wed, 23 Jul 2014 00:10:38 +0000 (18:10 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2014 02:15:20 +0000 (19:15 -0700)
_request_firmware_load() returns -ENOMEM when fw load is aborted after
timeout. Call is_fw_load_aborted() to check if fw load is aborted and
if true return -EAGAIN.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_class.c

index 124d50ceb116227639786ba63ada378e185f9aa2..da77791793f11ba948aee03e3a741cae5859a293 100644 (file)
@@ -906,7 +906,9 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
        wait_for_completion(&buf->completion);
 
        cancel_delayed_work_sync(&fw_priv->timeout_work);
-       if (!buf->data)
+       if (is_fw_load_aborted(buf))
+               retval = -EAGAIN;
+       else if (!buf->data)
                retval = -ENOMEM;
 
        device_remove_file(f_dev, &dev_attr_loading);