[PATCH 4/6] fbdev: Validate info->screen_{base, buffer} in fb_ops implementations

Geert Uytterhoeven geert at linux-m68k.org
Wed Apr 26 14:56:14 UTC 2023


Hi Thomas,


On Tue, Apr 25, 2023 at 4:28 PM Thomas Zimmermann <tzimmermann at suse.de> wrote:
> Push the test for info->screen_base from fb_read() and fb_write() into
> the implementations of struct fb_ops.{fb_read,fb_write}. In cases where
> the driver operates on info->screen_buffer, test this field instead.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>

Thanks for your patch!
You forgot to mention why it is a good idea to duplicate this in all
the implementations, instead of doing it once in the core?

>  drivers/video/fbdev/cobalt_lcdfb.c     |  6 ++++++
>  drivers/video/fbdev/core/fb_sys_fops.c |  6 ++++++
>  drivers/video/fbdev/core/fbmem.c       | 10 ++++++++--
>  drivers/video/fbdev/sm712fb.c          |  4 ++--
>  4 files changed, 22 insertions(+), 4 deletions(-)

Aren't there more fbdev drivers to fix, before you can move the checks
in drivers/video/fbdev/core/fbmem.c?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds


More information about the dri-devel mailing list