Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7abe5309 authored by Boris Brezillon's avatar Boris Brezillon
Browse files

mtd: maps: physmap: Return -ENOMEM directly when info allocation fails



There's no point going to the err_out path since no resources have
been allocated yet, just return -ENOMEM directly.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 1e4f4208
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -110,10 +110,8 @@ static int physmap_flash_probe(struct platform_device *dev)

	info = devm_kzalloc(&dev->dev, sizeof(struct physmap_flash_info),
			    GFP_KERNEL);
	if (info == NULL) {
		err = -ENOMEM;
		goto err_out;
	}
	if (!info)
		return -ENOMEM;

	while (platform_get_resource(dev, IORESOURCE_MEM, info->nmaps))
		info->nmaps++;