mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
fbdev: ssd1307fb: check for fb_deferred_io_init() error
fb_deferred_io_init() allocates deferred I/O state, populating
info->fbdefio_state, or leaving it NULL if an error occurs.
Currently ssd1307fb_probe() ignores its return value.
Therefore if an error arises in fb_deferred_io_init() (for instance, due
to an allocation failure) info->fbdefio_state is left NULL.
When the file is subsequently opened, fb_open() will dereference a NULL
pointer (calling fb_deferred_io_open()).
Fix this by checking for the error.
Fixes: 56c134f7f1 ("fbdev: Track deferred-I/O pages in pageref struct")
Cc: stable@vger.kernel.org
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
0c9cb9321c
commit
81ae1f9a6c
|
|
@ -767,7 +767,11 @@ static int ssd1307fb_probe(struct i2c_client *client)
|
|||
info->fix.smem_start = __pa(vmem);
|
||||
info->fix.smem_len = vmem_size;
|
||||
|
||||
fb_deferred_io_init(info);
|
||||
ret = fb_deferred_io_init(info);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to init fb deferred io: %d\n", ret);
|
||||
goto fb_defio_error;
|
||||
}
|
||||
|
||||
i2c_set_clientdata(client, info);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user