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

Commit 96cc112c authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

gayle: release resources on ide_host_add() failure



"gayle: reserve memory resources at once" patch temporary removed
freeing of resources on failure (to ease convertion to ide_host_add()
interface).  This patch fixes it.

Thanks to Geert for noticing the issue.

Noticed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent a0f403bc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ static int __init gayle_init(void)
    unsigned long phys_base, res_start, res_n;
    unsigned long base, ctrlport, irqport;
    ide_ack_intr_t *ack_intr;
    int a4000, i;
    int a4000, i, rc;
    hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };

    if (!MACH_IS_AMIGA)
@@ -179,7 +179,11 @@ static int __init gayle_init(void)
	hws[i] = &hw[i];
    }

    return ide_host_add(NULL, hws, NULL);
    rc = ide_host_add(NULL, hws, NULL);
    if (rc)
	release_mem_region(res_start, res_n);

    return rc;
}

module_init(gayle_init);