lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b52669c-4c99-45e2-8b5e-9348e5e00f70@t-8ch.de>
Date: Fri, 30 Aug 2024 09:17:45 +0200
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Helge Deller <deller@....de>, Bert Karwatzki <spasswolf@....de>
Cc: linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org, 
	linux-kernel@...r.kernel.org, Daniel Vetter <daniel@...ll.ch>, Peter Jones <pjones@...hat.com>
Subject: Re: [PATCH 3/5] fbdev: Introduce devm_register_framebuffer()

Hi everybody,

On 2024-08-27 17:25:14+0000, Thomas Weißschuh wrote:
> Introduce a device-managed variant of register_framebuffer() which
> automatically unregisters the framebuffer on device destruction.
> This can simplify the error handling and resource management in drivers.

Bert reported that this series broke his framebuffer ([0], [1]).

[0] https://lore.kernel.org/lkml/20240829224124.2978-1-spasswolf@web.de/
[1] https://lore.kernel.org/lkml/20240829230438.3226-1-spasswolf@web.de/

> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
> ---
>  drivers/video/fbdev/core/fbmem.c | 24 ++++++++++++++++++++++++
>  include/linux/fb.h               |  1 +
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
> index 4c4ad0a86a50..d17a2daa2483 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -544,6 +544,30 @@ unregister_framebuffer(struct fb_info *fb_info)

[..]

> +/**
> + *	devm_register_framebuffer - resource-managed frame buffer device registration
> + *	@dev: device the framebuffer belongs to
> + *	@fb_info: frame buffer info structure
> + *
> + *	Registers a frame buffer device @fb_info to device @dev.
> + *
> + *	Returns negative errno on error, or zero for success.
> + *
> + */
> +int
> +devm_register_framebuffer(struct device *dev, struct fb_info *fb_info)
> +{
> +	return devm_add_action_or_reset(dev, devm_unregister_framebuffer, fb_info);
> +}
> +EXPORT_SYMBOL(devm_register_framebuffer);

This implementation is wrong, it never actually registers the
framebuffer. It should look like this:

int
devm_register_framebuffer(struct device *dev, struct fb_info *fb_info)
{
	int ret;

	ret = register_framebuffer(fb_info);
	if (ret)
		return ret;

	return devm_add_action_or_reset(dev, devm_unregister_framebuffer, fb_info);
}
EXPORT_SYMBOL(devm_register_framebuffer);

Bert, could you test this?
Helge, do you want me to resend the series, minus the original patch 1?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ