]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/base/firmware_class.c
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
[karo-tx-linux.git] / drivers / base / firmware_class.c
index 8524450e75bd15d8f97327af84662b4af32fc3a7..b9250e564ebf008f36bd38de5c3df0e2c1efc5c9 100644 (file)
@@ -1118,15 +1118,17 @@ static int
 _request_firmware(const struct firmware **firmware_p, const char *name,
                  struct device *device, unsigned int opt_flags)
 {
-       struct firmware *fw;
+       struct firmware *fw = NULL;
        long timeout;
        int ret;
 
        if (!firmware_p)
                return -EINVAL;
 
-       if (!name || name[0] == '\0')
-               return -EINVAL;
+       if (!name || name[0] == '\0') {
+               ret = -EINVAL;
+               goto out;
+       }
 
        ret = _request_firmware_prepare(&fw, name, device);
        if (ret <= 0) /* error or already assigned */