All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 5941/11397] drivers/gpu/host1x/fence.c:156 host1x_fence_create() warn: possible memory leak of 'fence'
@ 2021-09-01 10:34 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-09-01  1:15 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1937 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Mikko Perttunen <mperttunen@nvidia.com>
CC: Thierry Reding <treding@nvidia.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   52c7b727581fe725f8b8a283af21fe0651c73c48
commit: 687db2207b1bc94ca34743871167923a6de78d85 [5941/11397] gpu: host1x: Add DMA fence implementation
:::::: branch date: 17 hours ago
:::::: commit date: 3 weeks ago
config: arm64-randconfig-m031-20210831 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/host1x/fence.c:156 host1x_fence_create() warn: possible memory leak of 'fence'

vim +/fence +156 drivers/gpu/host1x/fence.c

687db2207b1bc9 Mikko Perttunen 2021-06-10  145  
687db2207b1bc9 Mikko Perttunen 2021-06-10  146  struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold)
687db2207b1bc9 Mikko Perttunen 2021-06-10  147  {
687db2207b1bc9 Mikko Perttunen 2021-06-10  148  	struct host1x_syncpt_fence *fence;
687db2207b1bc9 Mikko Perttunen 2021-06-10  149  
687db2207b1bc9 Mikko Perttunen 2021-06-10  150  	fence = kzalloc(sizeof(*fence), GFP_KERNEL);
687db2207b1bc9 Mikko Perttunen 2021-06-10  151  	if (!fence)
687db2207b1bc9 Mikko Perttunen 2021-06-10  152  		return ERR_PTR(-ENOMEM);
687db2207b1bc9 Mikko Perttunen 2021-06-10  153  
687db2207b1bc9 Mikko Perttunen 2021-06-10  154  	fence->waiter = kzalloc(sizeof(*fence->waiter), GFP_KERNEL);
687db2207b1bc9 Mikko Perttunen 2021-06-10  155  	if (!fence->waiter)
687db2207b1bc9 Mikko Perttunen 2021-06-10 @156  		return ERR_PTR(-ENOMEM);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 43666 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [linux-next:master 5941/11397] drivers/gpu/host1x/fence.c:156 host1x_fence_create() warn: possible memory leak of 'fence'
@ 2021-09-01 10:34 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2021-09-01 10:34 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1723 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   52c7b727581fe725f8b8a283af21fe0651c73c48
commit: 687db2207b1bc94ca34743871167923a6de78d85 [5941/11397] gpu: host1x: Add DMA fence implementation
config: arm64-randconfig-m031-20210831 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/host1x/fence.c:156 host1x_fence_create() warn: possible memory leak of 'fence'

vim +/fence +156 drivers/gpu/host1x/fence.c

687db2207b1bc9 Mikko Perttunen 2021-06-10  145  
687db2207b1bc9 Mikko Perttunen 2021-06-10  146  struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold)
687db2207b1bc9 Mikko Perttunen 2021-06-10  147  {
687db2207b1bc9 Mikko Perttunen 2021-06-10  148  	struct host1x_syncpt_fence *fence;
687db2207b1bc9 Mikko Perttunen 2021-06-10  149  
687db2207b1bc9 Mikko Perttunen 2021-06-10  150  	fence = kzalloc(sizeof(*fence), GFP_KERNEL);
687db2207b1bc9 Mikko Perttunen 2021-06-10  151  	if (!fence)
687db2207b1bc9 Mikko Perttunen 2021-06-10  152  		return ERR_PTR(-ENOMEM);
687db2207b1bc9 Mikko Perttunen 2021-06-10  153  
687db2207b1bc9 Mikko Perttunen 2021-06-10  154  	fence->waiter = kzalloc(sizeof(*fence->waiter), GFP_KERNEL);
687db2207b1bc9 Mikko Perttunen 2021-06-10  155  	if (!fence->waiter)
687db2207b1bc9 Mikko Perttunen 2021-06-10 @156  		return ERR_PTR(-ENOMEM);

needs a kfree(fence);


---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-01 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  1:15 [linux-next:master 5941/11397] drivers/gpu/host1x/fence.c:156 host1x_fence_create() warn: possible memory leak of 'fence' kernel test robot
2021-09-01 10:34 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.