All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: drivers/auxdisplay/line-display.c:89 delete_attachment() warn: iterator used outside loop: 'attachment'
Date: Sat, 13 Dec 2025 19:19:42 +0800	[thread overview]
Message-ID: <202512131917.9L9pfhSQ-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: "Jean-François Lessard" <jefflessard3@gmail.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a859eca0e4cc96f63ff125dbe5388d961558b0e9
commit: 3ba5c78fe7c5d60edae0c47361f191d40c5c1cf0 auxdisplay: linedisp: support attribute attachment to auxdisplay devices
date:   8 weeks ago
:::::: branch date: 6 hours ago
:::::: commit date: 8 weeks ago
config: i386-randconfig-141-20251212 (https://download.01.org/0day-ci/archive/20251213/202512131917.9L9pfhSQ-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.4.0-5) 12.4.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202512131917.9L9pfhSQ-lkp@intel.com/

New smatch warnings:
drivers/auxdisplay/line-display.c:89 delete_attachment() warn: iterator used outside loop: 'attachment'

Old smatch warnings:
drivers/auxdisplay/line-display.c:110 to_linedisp() warn: iterator used outside loop: 'attachment'

vim +/attachment +89 drivers/auxdisplay/line-display.c

3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  72  
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  73  static struct linedisp *delete_attachment(struct device *dev, bool direct)
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  74  {
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  75  	struct linedisp_attachment *attachment;
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  76  	struct linedisp *linedisp;
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  77  
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  78  	guard(spinlock)(&linedisp_attachments_lock);
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  79  
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  80  	list_for_each_entry(attachment, &linedisp_attachments, list) {
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  81  		if (attachment->device == dev &&
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  82  		    attachment->direct == direct)
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  83  			break;
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  84  	}
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  85  
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  86  	if (list_entry_is_head(attachment, &linedisp_attachments, list))
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  87  		return NULL;
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  88  
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18 @89  	linedisp = attachment->linedisp;
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  90  	list_del(&attachment->list);
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  91  	kfree(attachment);
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  92  
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  93  	return linedisp;
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  94  }
3ba5c78fe7c5d6 Jean-François Lessard 2025-09-18  95  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2025-12-13 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-13 11:19 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-08-06 16:40 drivers/auxdisplay/line-display.c:89 delete_attachment() warn: iterator used outside loop: 'attachment' kernel test robot

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=202512131917.9L9pfhSQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@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.