Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

misc: fastrpc: fix memory leak when out of memory

Do the necessary house-keeping if the allocated memory wont be used

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Link: https://lore.kernel.org/r/20190705081303.14170-1-jorge.ramirez-ortiz@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jorge Ramirez-Ortiz and committed by
Greg Kroah-Hartman
41db5f83 0854d589

+4 -1
+4 -1
drivers/misc/fastrpc.c
··· 279 279 280 280 buf->virt = dma_alloc_coherent(dev, buf->size, (dma_addr_t *)&buf->phys, 281 281 GFP_KERNEL); 282 - if (!buf->virt) 282 + if (!buf->virt) { 283 + mutex_destroy(&buf->lock); 284 + kfree(buf); 283 285 return -ENOMEM; 286 + } 284 287 285 288 if (fl->sctx && fl->sctx->sid) 286 289 buf->phys += ((u64)fl->sctx->sid << 32);