Merge branch 'regulator-4.20' into regulator-next
[linux-2.6-block.git] / drivers / base / firmware_loader / main.c
index b3c0498ee4331f4c2a47a72fb74bce9328b4486e..8e9213b36e31371aed574de0252366f171e6104f 100644 (file)
@@ -226,8 +226,11 @@ static int alloc_lookup_fw_priv(const char *fw_name,
        }
 
        tmp = __allocate_fw_priv(fw_name, fwc, dbuf, size);
-       if (tmp && !(opt_flags & FW_OPT_NOCACHE))
-               list_add(&tmp->list, &fwc->head);
+       if (tmp) {
+               INIT_LIST_HEAD(&tmp->list);
+               if (!(opt_flags & FW_OPT_NOCACHE))
+                       list_add(&tmp->list, &fwc->head);
+       }
        spin_unlock(&fwc->lock);
 
        *fw_priv = tmp;