* [linux-next:pending-fixes 303/393] drivers/media/test-drivers/vidtv/vidtv_s302m.c:475 vidtv_s302m_encoder_init() warn: possible memory leak of 'e'
@ 2020-11-27 4:10 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-11-27 4:10 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 5608 bytes --]
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git pending-fixes
head: c7cab83d100f5af1c10580fe567f8c29779a7e4e
commit: 3be8037960bccd13052cfdeba8805ad785041d70 [303/393] media: vidtv: add error checks
:::::: branch date: 6 hours ago
:::::: commit date: 21 hours ago
config: i386-randconfig-m021-20201127 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.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/media/test-drivers/vidtv/vidtv_s302m.c:475 vidtv_s302m_encoder_init() warn: possible memory leak of 'e'
vim +/e +475 drivers/media/test-drivers/vidtv/vidtv_s302m.c
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 444
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 445 struct vidtv_encoder
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 446 *vidtv_s302m_encoder_init(struct vidtv_s302m_encoder_init_args args)
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 447 {
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 448 struct vidtv_encoder *e;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 449 u32 priv_sz = sizeof(struct vidtv_s302m_ctx);
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 450 struct vidtv_s302m_ctx *ctx;
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 451
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 452 e = kzalloc(sizeof(*e), GFP_KERNEL);
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 453 if (!e)
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 454 return NULL;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 455
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 456 e->id = S302M;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 457
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 458 if (args.name)
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 459 e->name = kstrdup(args.name, GFP_KERNEL);
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 460
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 461 e->encoder_buf = vzalloc(VIDTV_S302M_BUF_SZ);
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 462 e->encoder_buf_sz = VIDTV_S302M_BUF_SZ;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 463 e->encoder_buf_offset = 0;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 464
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 465 e->sample_count = 0;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 466
c2a9baf96fe72f Mauro Carvalho Chehab 2020-09-15 467 e->src_buf = (args.src_buf) ? args.src_buf : NULL;
c2a9baf96fe72f Mauro Carvalho Chehab 2020-09-15 468 e->src_buf_sz = (args.src_buf) ? args.src_buf_sz : 0;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 469 e->src_buf_offset = 0;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 470
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 471 e->is_video_encoder = false;
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 472
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 473 ctx = kzalloc(priv_sz, GFP_KERNEL);
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 474 if (!ctx)
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 @475 return NULL;
3be8037960bccd Mauro Carvalho Chehab 2020-09-21 476
99b99d135ee3fd Daniel W. S. Almeida 2020-10-31 477 e->ctx = ctx;
99b99d135ee3fd Daniel W. S. Almeida 2020-10-31 478 ctx->last_duration = 0;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 479
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 480 e->encode = vidtv_s302m_encode;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 481 e->clear = vidtv_s302m_clear;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 482
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 483 e->es_pid = cpu_to_be16(args.es_pid);
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 484 e->stream_id = cpu_to_be16(PES_PRIVATE_STREAM_1);
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 485
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 486 e->sync = args.sync;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 487 e->sampling_rate_hz = S302M_SAMPLING_RATE_HZ;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 488
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 489 e->last_sample_cb = args.last_sample_cb;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 490
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 491 e->destroy = vidtv_s302m_encoder_destroy;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 492
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 493 if (args.head) {
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 494 while (args.head->next)
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 495 args.head = args.head->next;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 496
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 497 args.head->next = e;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 498 }
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 499
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 500 e->next = NULL;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 501
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 502 return e;
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 503 }
f90cf6079bf679 Daniel W. S. Almeida 2020-08-21 504
---
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: 35008 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-27 4:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 4:10 [linux-next:pending-fixes 303/393] drivers/media/test-drivers/vidtv/vidtv_s302m.c:475 vidtv_s302m_encoder_init() warn: possible memory leak of 'e' kernel test robot
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.