mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
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: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
1e4f420849
commit
7abe5309de
1 changed files with 2 additions and 4 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Reference in a new issue