Skip to content
Commit 4daa9ff8 authored by Luiz Sampaio's avatar Luiz Sampaio Committed by Miguel Ojeda
Browse files

auxdisplay: charlcd: checking for pointer reference before dereferencing



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>
parent 94047df1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment