[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202510301541.ExxRSMBP-lkp@intel.com>
Date: Thu, 30 Oct 2025 16:37:35 +0800
From: kernel test robot <lkp@...el.com>
To: Biancaa Ramesh <biancaa2210329@....edu.in>,
linux-kernel@...r.kernel.org
Cc: oe-kbuild-all@...ts.linux.dev, awalls@...metrocast.net,
mchehab@...nel.org, linux-media@...r.kernel.org,
Biancaa Ramesh <biancaa2210329@....edu.in>
Subject: Re: [PATCH] kernel memory safety check in a block
Hi Biancaa,
kernel test robot noticed the following build warnings:
[auto build test WARNING on sailus-media-tree/master]
[also build test WARNING on linus/master v6.18-rc3 next-20251029]
[cannot apply to sailus-media-tree/streams]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Biancaa-Ramesh/kernel-memory-safety-check-in-a-block/20251022-041827
base: git://linuxtv.org/sailus/media_tree.git master
patch link: https://lore.kernel.org/r/20251021201704.178535-1-biancaa2210329%40ssn.edu.in
patch subject: [PATCH] kernel memory safety check in a block
config: um-randconfig-r073-20251025 (https://download.01.org/0day-ci/archive/20251030/202510301541.ExxRSMBP-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project e1ae12640102fd2b05bc567243580f90acb1135f)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510301541.ExxRSMBP-lkp@intel.com/
New smatch warnings:
drivers/media/pci/cx18/cx18-queue.c:389 cx18_stream_alloc() warn: inconsistent indenting
Old smatch warnings:
drivers/media/pci/cx18/cx18-queue.c:392 cx18_stream_alloc() warn: inconsistent indenting
vim +389 drivers/media/pci/cx18/cx18-queue.c
331
332 int cx18_stream_alloc(struct cx18_stream *s)
333 {
334 struct cx18 *cx = s->cx;
335 int i;
336
337 if (s->buffers == 0)
338 return 0;
339
340 CX18_DEBUG_INFO("Allocate %s stream: %d x %d buffers (%d.%02d kB total)\n",
341 s->name, s->buffers, s->buf_size,
342 s->buffers * s->buf_size / 1024,
343 (s->buffers * s->buf_size * 100 / 1024) % 100);
344
345 if (((char __iomem *)&cx->scb->cpu_mdl[cx->free_mdl_idx + s->buffers] -
346 (char __iomem *)cx->scb) > SCB_RESERVED_SIZE) {
347 unsigned bufsz = (((char __iomem *)cx->scb) + SCB_RESERVED_SIZE -
348 ((char __iomem *)cx->scb->cpu_mdl));
349
350 CX18_ERR("Too many buffers, cannot fit in SCB area\n");
351 CX18_ERR("Max buffers = %zu\n",
352 bufsz / sizeof(struct cx18_mdl_ent));
353 return -ENOMEM;
354 }
355
356 s->mdl_base_idx = cx->free_mdl_idx;
357
358 /* allocate stream buffers and MDLs */
359 for (i = 0; i < s->buffers; i++) {
360 struct cx18_mdl *mdl;
361 struct cx18_buffer *buf;
362
363 /* 1 MDL per buffer to handle the worst & also default case */
364 mdl = kzalloc(sizeof(struct cx18_mdl), GFP_KERNEL|__GFP_NOWARN);
365 if (mdl == NULL)
366 break;
367
368 buf = kzalloc(sizeof(struct cx18_buffer),
369 GFP_KERNEL|__GFP_NOWARN);
370 if (buf == NULL) {
371 kfree(mdl);
372 break;
373 }
374
375 buf->buf = kmalloc(s->buf_size, GFP_KERNEL|__GFP_NOWARN);
376 if (buf->buf == NULL) {
377 kfree(mdl);
378 kfree(buf);
379 break;
380 }
381
382 buf->dma_handle = dma_map_single(&s->cx->pci_dev->dev,
383 buf->buf, s->buf_size,
384 s->dma);
385 if (dma_mapping_error(&s->cx->pci_dev->dev, buf->dma_handle)) {
386 if (buf) {
387 if (buf->buf){
388 kfree(buf->buf);
> 389 buf->buf =NULL;
390 }
391 kfree(buf);
392 buf=NULL;
393 }
394 kfree(mdl);
395 //makes accidental double free less possible
396 break;
397 }
398
399 INIT_LIST_HEAD(&mdl->list);
400 INIT_LIST_HEAD(&mdl->buf_list);
401 mdl->id = s->mdl_base_idx; /* a somewhat safe value */
402 cx18_enqueue(s, mdl, &s->q_idle);
403
404 INIT_LIST_HEAD(&buf->list);
405 cx18_buf_sync_for_cpu(s, buf);
406 list_add_tail(&buf->list, &s->buf_pool);
407 }
408 if (i == s->buffers) {
409 cx->free_mdl_idx += s->buffers;
410 return 0;
411 }
412 CX18_ERR("Couldn't allocate buffers for %s stream\n", s->name);
413 cx18_stream_free(s);
414 return -ENOMEM;
415 }
416
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists