Skip to content
Snippets Groups Projects
user avatar
Luiz Sampaio authored
[ Upstream commit 4daa9ff8 ]

Check if the pointer lcd->ops->init_display exists before dereferencing it.
If a driver called charlcd_init() without defining the ops, this would
return segmentation fault, as happened to me when implementing a charlcd
driver.  Checking the pointer before dereferencing protects from
segmentation fault.

Signed-off-by: default avatarLuiz Sampaio <sampaio.ime@gmail.com>
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
4ed66cdc
History
Name Last commit Last update