Re: [patch] usb: gadget: f_tcm: memory leak on error in tcm_alloc_inst()
Dan Carpenterwrites: > We need to kfree(opts) on error. Also it's nicer to allocate opts > before taking the lock. > > Signed-off-by: Dan Carpenter what's the base for this commit ? I don't have f_tcm.c anywhere. -- balbi signature.asc
[patch] usb: gadget: f_tcm: memory leak on error in tcm_alloc_inst()
We need to kfree(opts) on error. Also it's nicer to allocate opts before taking the lock. Signed-off-by: Dan Carpenterdiff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index ed47e40..0a26a2e 100644 ---