Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@ajitkupandey this can only happen if you add a PCI_DEVICE without the matching .driver_data set, right? That's typically only in developer workspaces, and even then that's pretty bad, isn't it?
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.
Yes this happens only when .driver_data isn't set in pci driver. Actually i ended up in this exception once due to missing driver data so thought to fix this one. I agree that's pretty bad and part of developer workspace only but I guess avoiding exceptions in core code is always good.
If this double NULL check looks weird here may be fixup like adding a "pci_id->driver_data" NULL check in sof pci device probe like "hda_pci_intel_probe" before invoking sof_pci_probe can be done to avoid such exceptions.
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.
It's fine to do it here, just that you should add in the commit message that this is a paranoia check for something that should not happen for an actual released product.