Merge "spmi: Add check for NULL and invalid controller pointer"