1

additional fbdev fixes for 6.12-rc1:

- crash fix in fbcon_putcs
 - avoid a possible string memory overflow in sisfb
 - minor code optimizations in omapfb and fbcon
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCZvfmvgAKCRD3ErUQojoP
 XxcKAP444xoWxF5zDLAl4xczeC1lnMazgY5W7ELFMNDxQ2PPlwD/Tmn/V1EzLRoZ
 MOiVtMpM5K7kIRUKdcjKVCltI/mpgQ8=
 =6eO2
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-for-6.12-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes from Helge Deller:

 - crash fix in fbcon_putcs

 - avoid a possible string memory overflow in sisfb

 - minor code optimizations in omapfb and fbcon

* tag 'fbdev-for-6.12-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: sisfb: Fix strbuf array overflow
  fbcon: break earlier in search_fb_in_map and search_for_mapped_con
  fbdev: omapfb: Call of_node_put(ep) only once in omapdss_of_find_source_for_first_ep()
  fbcon: Fix a NULL pointer dereference issue in fbcon_putcs
This commit is contained in:
Linus Torvalds 2024-09-28 09:00:38 -07:00
commit f95c139099
3 changed files with 11 additions and 8 deletions

View File

@ -512,8 +512,10 @@ static int search_fb_in_map(int idx)
int i, retval = 0; int i, retval = 0;
for (i = first_fb_vc; i <= last_fb_vc; i++) { for (i = first_fb_vc; i <= last_fb_vc; i++) {
if (con2fb_map[i] == idx) if (con2fb_map[i] == idx) {
retval = 1; retval = 1;
break;
}
} }
return retval; return retval;
} }
@ -523,8 +525,10 @@ static int search_for_mapped_con(void)
int i, retval = 0; int i, retval = 0;
for (i = first_fb_vc; i <= last_fb_vc; i++) { for (i = first_fb_vc; i <= last_fb_vc; i++) {
if (con2fb_map[i] != -1) if (con2fb_map[i] != -1) {
retval = 1; retval = 1;
break;
}
} }
return retval; return retval;
} }
@ -861,6 +865,8 @@ static int set_con2fb_map(int unit, int newidx, int user)
return err; return err;
fbcon_add_cursor_work(info); fbcon_add_cursor_work(info);
} else if (vc) {
set_blitting_type(vc, info);
} }
con2fb_map[unit] = newidx; con2fb_map[unit] = newidx;

View File

@ -129,12 +129,9 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
src_port = of_graph_get_remote_port(ep); src_port = of_graph_get_remote_port(ep);
if (!src_port) {
of_node_put(ep);
return ERR_PTR(-EINVAL);
}
of_node_put(ep); of_node_put(ep);
if (!src_port)
return ERR_PTR(-EINVAL);
src = omap_dss_find_output_by_port_node(src_port); src = omap_dss_find_output_by_port_node(src_port);

View File

@ -183,7 +183,7 @@ static void sisfb_search_mode(char *name, bool quiet)
{ {
unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0; unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0;
int i = 0; int i = 0;
char strbuf[16], strbuf1[20]; char strbuf[24], strbuf1[20];
char *nameptr = name; char *nameptr = name;
/* We don't know the hardware specs yet and there is no ivideo */ /* We don't know the hardware specs yet and there is no ivideo */