Skip to content

Commit 9e87b63

Browse files
committed
Merge tag 'fbdev-for-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev
Pull fbdev fixes from Helge Deller: "Most notable is a fix for a null-ptr-deref in fbcon's soft_cursor function which was found by syzbot. - Fix null-ptr-deref in soft_cursor - various remove callback conversions - error path fixes in imsttfb" * tag 'fbdev-for-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: bw2: Convert to platform remove callback returning void fbdev: broadsheetfb: Convert to platform remove callback returning void fbdev: au1200fb: Convert to platform remove callback returning void fbdev: au1100fb: Convert to platform remove callback returning void fbdev: arcfb: Convert to platform remove callback returning void fbdev: au1100fb: Drop if with an always false condition fbcon: Fix null-ptr-deref in soft_cursor fbdev: imsttfb: Fix error path of imsttfb_probe() fbdev: imsttfb: Release framebuffer and dealloc cmap on error path fbdev: matroxfb ssd1307fb: Switch i2c drivers back to use .probe()
2 parents b0e7815 + d19663e commit 9e87b63

File tree

9 files changed

+25
-27
lines changed

9 files changed

+25
-27
lines changed

drivers/video/fbdev/arcfb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ static int arcfb_probe(struct platform_device *dev)
590590
return retval;
591591
}
592592

593-
static int arcfb_remove(struct platform_device *dev)
593+
static void arcfb_remove(struct platform_device *dev)
594594
{
595595
struct fb_info *info = platform_get_drvdata(dev);
596596

@@ -601,12 +601,11 @@ static int arcfb_remove(struct platform_device *dev)
601601
vfree((void __force *)info->screen_base);
602602
framebuffer_release(info);
603603
}
604-
return 0;
605604
}
606605

607606
static struct platform_driver arcfb_driver = {
608607
.probe = arcfb_probe,
609-
.remove = arcfb_remove,
608+
.remove_new = arcfb_remove,
610609
.driver = {
611610
.name = "arcfb",
612611
},

drivers/video/fbdev/au1100fb.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,10 @@ static int au1100fb_drv_probe(struct platform_device *dev)
520520
return -ENODEV;
521521
}
522522

523-
int au1100fb_drv_remove(struct platform_device *dev)
523+
void au1100fb_drv_remove(struct platform_device *dev)
524524
{
525525
struct au1100fb_device *fbdev = NULL;
526526

527-
if (!dev)
528-
return -ENODEV;
529-
530527
fbdev = platform_get_drvdata(dev);
531528

532529
#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
@@ -543,8 +540,6 @@ int au1100fb_drv_remove(struct platform_device *dev)
543540
clk_disable_unprepare(fbdev->lcdclk);
544541
clk_put(fbdev->lcdclk);
545542
}
546-
547-
return 0;
548543
}
549544

550545
#ifdef CONFIG_PM
@@ -593,9 +588,9 @@ static struct platform_driver au1100fb_driver = {
593588
.name = "au1100-lcd",
594589
},
595590
.probe = au1100fb_drv_probe,
596-
.remove = au1100fb_drv_remove,
591+
.remove_new = au1100fb_drv_remove,
597592
.suspend = au1100fb_drv_suspend,
598-
.resume = au1100fb_drv_resume,
593+
.resume = au1100fb_drv_resume,
599594
};
600595
module_platform_driver(au1100fb_driver);
601596

drivers/video/fbdev/au1200fb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,7 @@ static int au1200fb_drv_probe(struct platform_device *dev)
17651765
return ret;
17661766
}
17671767

1768-
static int au1200fb_drv_remove(struct platform_device *dev)
1768+
static void au1200fb_drv_remove(struct platform_device *dev)
17691769
{
17701770
struct au1200fb_platdata *pd = platform_get_drvdata(dev);
17711771
struct fb_info *fbi;
@@ -1788,8 +1788,6 @@ static int au1200fb_drv_remove(struct platform_device *dev)
17881788
}
17891789

17901790
free_irq(platform_get_irq(dev, 0), (void *)dev);
1791-
1792-
return 0;
17931791
}
17941792

17951793
#ifdef CONFIG_PM
@@ -1840,7 +1838,7 @@ static struct platform_driver au1200fb_driver = {
18401838
.pm = AU1200FB_PMOPS,
18411839
},
18421840
.probe = au1200fb_drv_probe,
1843-
.remove = au1200fb_drv_remove,
1841+
.remove_new = au1200fb_drv_remove,
18441842
};
18451843
module_platform_driver(au1200fb_driver);
18461844

drivers/video/fbdev/broadsheetfb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ static int broadsheetfb_probe(struct platform_device *dev)
11931193

11941194
}
11951195

1196-
static int broadsheetfb_remove(struct platform_device *dev)
1196+
static void broadsheetfb_remove(struct platform_device *dev)
11971197
{
11981198
struct fb_info *info = platform_get_drvdata(dev);
11991199

@@ -1209,12 +1209,11 @@ static int broadsheetfb_remove(struct platform_device *dev)
12091209
module_put(par->board->owner);
12101210
framebuffer_release(info);
12111211
}
1212-
return 0;
12131212
}
12141213

12151214
static struct platform_driver broadsheetfb_driver = {
12161215
.probe = broadsheetfb_probe,
1217-
.remove = broadsheetfb_remove,
1216+
.remove_new = broadsheetfb_remove,
12181217
.driver = {
12191218
.name = "broadsheetfb",
12201219
},

drivers/video/fbdev/bw2.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int bw2_probe(struct platform_device *op)
352352
return err;
353353
}
354354

355-
static int bw2_remove(struct platform_device *op)
355+
static void bw2_remove(struct platform_device *op)
356356
{
357357
struct fb_info *info = dev_get_drvdata(&op->dev);
358358
struct bw2_par *par = info->par;
@@ -363,8 +363,6 @@ static int bw2_remove(struct platform_device *op)
363363
of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len);
364364

365365
framebuffer_release(info);
366-
367-
return 0;
368366
}
369367

370368
static const struct of_device_id bw2_match[] = {
@@ -381,7 +379,7 @@ static struct platform_driver bw2_driver = {
381379
.of_match_table = bw2_match,
382380
},
383381
.probe = bw2_probe,
384-
.remove = bw2_remove,
382+
.remove_new = bw2_remove,
385383
};
386384

387385
static int __init bw2_init(void)

drivers/video/fbdev/core/bitblit.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
247247

248248
cursor.set = 0;
249249

250+
if (!vc->vc_font.data)
251+
return;
252+
250253
c = scr_readw((u16 *) vc->vc_pos);
251254
attribute = get_attribute(info, c);
252255
src = vc->vc_font.data + ((c & charmask) * (w * vc->vc_font.height));

drivers/video/fbdev/imsttfb.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,9 +1452,13 @@ static int init_imstt(struct fb_info *info)
14521452
FBINFO_HWACCEL_FILLRECT |
14531453
FBINFO_HWACCEL_YPAN;
14541454

1455-
fb_alloc_cmap(&info->cmap, 0, 0);
1455+
if (fb_alloc_cmap(&info->cmap, 0, 0)) {
1456+
framebuffer_release(info);
1457+
return -ENODEV;
1458+
}
14561459

14571460
if (register_framebuffer(info) < 0) {
1461+
fb_dealloc_cmap(&info->cmap);
14581462
framebuffer_release(info);
14591463
return -ENODEV;
14601464
}
@@ -1531,8 +1535,10 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
15311535
goto error;
15321536
info->pseudo_palette = par->palette;
15331537
ret = init_imstt(info);
1534-
if (!ret)
1535-
pci_set_drvdata(pdev, info);
1538+
if (ret)
1539+
goto error;
1540+
1541+
pci_set_drvdata(pdev, info);
15361542
return ret;
15371543

15381544
error:

drivers/video/fbdev/matrox/matroxfb_maven.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ static struct i2c_driver maven_driver={
12911291
.driver = {
12921292
.name = "maven",
12931293
},
1294-
.probe_new = maven_probe,
1294+
.probe = maven_probe,
12951295
.remove = maven_remove,
12961296
.id_table = maven_id,
12971297
};

drivers/video/fbdev/ssd1307fb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ static const struct i2c_device_id ssd1307fb_i2c_id[] = {
844844
MODULE_DEVICE_TABLE(i2c, ssd1307fb_i2c_id);
845845

846846
static struct i2c_driver ssd1307fb_driver = {
847-
.probe_new = ssd1307fb_probe,
847+
.probe = ssd1307fb_probe,
848848
.remove = ssd1307fb_remove,
849849
.id_table = ssd1307fb_i2c_id,
850850
.driver = {

0 commit comments

Comments
 (0)