gdev: fix reference of null pointer