mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
fbdev: ssd1307fb: fix NULL pointer dereference on missing match data
device_get_match_data() can return NULL, e.g. when the device is matched through the I2C device ID table rather than the OF match table. The returned value is stored in par->device_info and later dereferenced when initializing par->vcomh, causing a NULL pointer dereference. Check the return value right after the assignment and bail out with -ENODEV (releasing the already allocated framebuffer) before any dereference. Signed-off-by: Yang Zi <2959243019@qq.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
94e6a058b1
commit
3fb13d29cf
1 changed files with 4 additions and 0 deletions
Loading…
Add table
Add a link
Reference in a new issue