]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fbdev: hpfb: Fix an error handling path in hpfb_dio_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 1 Aug 2024 20:34:39 +0000 (22:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:07:45 +0000 (15:07 +0200)
[ Upstream commit aa578e897520f32ae12bec487f2474357d01ca9c ]

If an error occurs after request_mem_region(), a corresponding
release_mem_region() should be called, as already done in the remove
function.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/hpfb.c

index 8d418abdd7678a152a073ac666aa2b80fa671ea3..1e9c52e2714dd9b60c0cea2e3bb1027f5dfadd5a 100644 (file)
@@ -344,6 +344,7 @@ static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent)
        if (hpfb_init_one(paddr, vaddr)) {
                if (d->scode >= DIOII_SCBASE)
                        iounmap((void *)vaddr);
+               release_mem_region(d->resource.start, resource_size(&d->resource));
                return -ENOMEM;
        }
        return 0;