gpu: properly handle dereferencing of pointers to struct