Commit f3f7317f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: fix memory leak in auerswald driver.

Thanks to Joilnen Leite <knl_joi@yahoo.com.br> for pointing this out.
parent a0c3c07d
......@@ -774,7 +774,7 @@ static void auerbuf_free_buffers (pauerbufctl_t bcp)
/* requirement: auerbuf_init() */
static int auerbuf_setup (pauerbufctl_t bcp, unsigned int numElements, unsigned int bufsize)
{
pauerbuf_t bep;
pauerbuf_t bep = NULL;
dbg ("auerbuf_setup called with %d elements of %d bytes", numElements, bufsize);
......@@ -801,6 +801,7 @@ static int auerbuf_setup (pauerbufctl_t bcp, unsigned int numElements, unsigned
bl_fail:/* not enough memory. Free allocated elements */
dbg ("auerbuf_setup: no more memory");
kfree(bep);
auerbuf_free_buffers (bcp);
return -ENOMEM;
}
......
Markdown is supported
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