Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e32672f0 authored by Felipe Balbi's avatar Felipe Balbi
Browse files

usb: dwc3: core: don't kfree() devm_kzalloc()'ed memory



commit 380f0d28 (usb: dwc3: core: switch event
buffer allocation to devm_kzalloc()) was incomplete
leaving a trailing kfree(evt) in an error exit
path.

Fix this problem by removing the trailing kfree(evt).

Cc: Julia Lawall <julia.lawall@lip6.fr>
Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 7947699a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -153,10 +153,8 @@ dwc3_alloc_one_event_buffer(struct dwc3 *dwc, unsigned length)
	evt->length	= length;
	evt->buf	= dma_alloc_coherent(dwc->dev, length,
			&evt->dma, GFP_KERNEL);
	if (!evt->buf) {
		kfree(evt);
	if (!evt->buf)
		return ERR_PTR(-ENOMEM);
	}

	return evt;
}