-
Notifications
You must be signed in to change notification settings - Fork 607
Add NULL-check platform_data before dereferencing in devicemodel_probe#363
Add NULL-check platform_data before dereferencing in devicemodel_probe#363EricccTaiwan wants to merge 1 commit intosysprog21:masterfrom
Conversation
dev->dev.platform_data is optional and not guaranteed to be set by the platform device registrar. Add a NULL guard and return -EINVAL to fail the probe cleanly instead of crashing the kernel with a NULL dereference.
Summary by cubic
Add a NULL check for platform_data in devicemodel_probe to prevent a NULL dereference and kernel crash. If platform data is missing, log an error and return -EINVAL to fail the probe cleanly.
Written for commit 1d3a336. Summary will update on new commits.
platform device registrar. Add a NULL guard and return -EINVAL to fail
the probe cleanly instead of crashing the kernel with a NULL dereference.
Signed-off-by: Cheng-Yang Chou
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
|
To better justify this change, could you please clarify what are the specific conditions or execution paths that would trigger a NULL platform_data? |