All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Biancaa Ramesh <biancaa2210329@ssn.edu.in>, linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, awalls@md.metrocast.net,
	mchehab@kernel.org, linux-media@vger.kernel.org,
	Biancaa Ramesh <biancaa2210329@ssn.edu.in>
Subject: Re: [PATCH] kernel memory safety check in a block
Date: Thu, 30 Oct 2025 16:37:35 +0800	[thread overview]
Message-ID: <202510301541.ExxRSMBP-lkp@intel.com> (raw)
In-Reply-To: <20251021201704.178535-1-biancaa2210329@ssn.edu.in>

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@intel.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

  parent reply	other threads:[~2025-10-30  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 20:17 [PATCH] kernel memory safety check in a block Biancaa Ramesh
2025-10-22 10:20 ` Sakari Ailus
2025-10-30  8:37 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-10-21 19:54 Biancaa Ramesh
2025-10-21 17:57 Biancaa Ramesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202510301541.ExxRSMBP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=awalls@md.metrocast.net \
    --cc=biancaa2210329@ssn.edu.in \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.