[added to the 4.1 stable tree] usb: gadget: don't dereference g until after it has been null checked