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

Commit 2566faae authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: Avoid incorrect memory leaks reported by kmemleak tool."

parents 715d84f9 7a7af2c9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/usb/gadget.h>
#include <linux/workqueue.h>
#include <linux/debugfs.h>
#include <linux/kmemleak.h>

static DEFINE_SPINLOCK(ch_lock);
static LIST_HEAD(usb_diag_ch_list);
@@ -380,6 +381,7 @@ int usb_diag_alloc_req(struct usb_diag_ch *ch, int n_write, int n_read)
		req = usb_ep_alloc_request(ctxt->in, GFP_ATOMIC);
		if (!req)
			goto fail;
		kmemleak_not_leak(req);
		req->complete = diag_write_complete;
		list_add_tail(&req->list, &ctxt->write_pool);
	}
@@ -388,6 +390,7 @@ int usb_diag_alloc_req(struct usb_diag_ch *ch, int n_write, int n_read)
		req = usb_ep_alloc_request(ctxt->out, GFP_ATOMIC);
		if (!req)
			goto fail;
		kmemleak_not_leak(req);
		req->complete = diag_read_complete;
		list_add_tail(&req->list, &ctxt->read_pool);
	}