There's no point going to the err_out path since no resources have
been allocated yet, just return -ENOMEM directly.
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
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++;