Skip to content
Commit b2fc059f authored by Colin Ian King's avatar Colin Ian King Committed by Felipe Balbi
Browse files

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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 593e789f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment