diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index 184cb97c83bd..b6183f1f4ebc 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -577,6 +577,8 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size, raw_spin_lock_init(&prz->buffer_lock); prz->flags = flags; prz->label = kstrdup(label, GFP_KERNEL); + if (!prz->label) + goto err; ret = persistent_ram_buffer_map(start, size, prz, memtype); if (ret)