usb: gadget: don't dereference g until after it has been null checked
Avoid dereferencing pointer g until after g has been sanity null checked;
move the assignment of cdev much later when it is required into a more
local scope.
Detected by CoverityScan, CID#1222135 ("Dereference before null check")
Fixes: b785ea7c ("usb: gadget: composite: fix ep->maxburst initialization")
Signed-off-by:
Colin Ian King <colin.king@canonical.com>
Signed-off-by:
Felipe Balbi <felipe.balbi@linux.intel.com>
Loading
Please register or sign in to comment