summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/sram.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index b33ab8ce47ab..07ec2a8a9343 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -249,8 +249,10 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res)
block->label = devm_kstrdup(sram->dev,
label, GFP_KERNEL);
- if (!block->label)
+ if (!block->label) {
+ ret = -ENOMEM;
goto err_chunks;
+ }
dev_dbg(sram->dev, "found %sblock '%s' 0x%x-0x%x\n",
block->export ? "exported " : "", block->label,