All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android14-6.1 7/7] fs/incfs/pseudo_files.c:1076:22: sparse: sparse: Using plain integer as NULL pointer
Date: Tue, 24 Mar 2026 16:33:26 +0800	[thread overview]
Message-ID: <202603241635.VXniY6dM-lkp@intel.com> (raw)

tree:   https://android.googlesource.com/kernel/common android14-6.1
head:   c0665c721df9b82c4652604d24aa91456058230b
commit: e302f3a21b6554722c72787fddc4780c0280e88b [7/7] ANDROID: incremental-fs: Make work with 16k pages
config: arm64-randconfig-r122-20260324 (https://download.01.org/0day-ci/archive/20260324/202603241635.VXniY6dM-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 10.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260324/202603241635.VXniY6dM-lkp@intel.com/reproduce)

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/202603241635.VXniY6dM-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/incfs/pseudo_files.c:1076:22: sparse: sparse: Using plain integer as NULL pointer

vim +1076 fs/incfs/pseudo_files.c

  1066	
  1067	static ssize_t log_read(struct file *f, char __user *buf, size_t len,
  1068				loff_t *ppos)
  1069	{
  1070		struct log_file_state *log_state = f->private_data;
  1071		struct mount_info *mi = get_mount_info(file_superblock(f));
  1072		int total_reads_collected = 0;
  1073		int rl_size;
  1074		ssize_t result = 0;
  1075		bool report_uid;
> 1076		void *page = 0;
  1077		struct incfs_pending_read_info *reads_buf = NULL;
  1078		struct incfs_pending_read_info2 *reads_buf2 = NULL;
  1079		size_t record_size;
  1080		ssize_t reads_to_collect;
  1081		ssize_t reads_per_page;
  1082	
  1083		if (!mi)
  1084			return -EFAULT;
  1085	
  1086		report_uid = mi->mi_options.report_uid;
  1087		record_size = report_uid ? sizeof(*reads_buf2) : sizeof(*reads_buf);
  1088		reads_to_collect = len / record_size;
  1089		reads_per_page = INCFS_DATA_FILE_BLOCK_SIZE / record_size;
  1090	
  1091		rl_size = READ_ONCE(mi->mi_log.rl_size);
  1092		if (rl_size == 0)
  1093			return 0;
  1094	
  1095		page = kzalloc(INCFS_DATA_FILE_BLOCK_SIZE, GFP_NOFS);
  1096		if (!page)
  1097			return -ENOMEM;
  1098	
  1099		if (report_uid)
  1100			reads_buf2 = (struct incfs_pending_read_info2 *)page;
  1101		else
  1102			reads_buf = (struct incfs_pending_read_info *)page;
  1103	
  1104		reads_to_collect = min_t(ssize_t, rl_size, reads_to_collect);
  1105		while (reads_to_collect > 0) {
  1106			struct read_log_state next_state;
  1107			int reads_collected;
  1108	
  1109			memcpy(&next_state, &log_state->state, sizeof(next_state));
  1110			reads_collected = incfs_collect_logged_reads(
  1111				mi, &next_state, reads_buf, reads_buf2,
  1112				min_t(ssize_t, reads_to_collect, reads_per_page));
  1113			if (reads_collected <= 0) {
  1114				result = total_reads_collected ?
  1115					       total_reads_collected * record_size :
  1116					       reads_collected;
  1117				goto out;
  1118			}
  1119			if (copy_to_user(buf, page,
  1120					 reads_collected * record_size)) {
  1121				result = total_reads_collected ?
  1122					       total_reads_collected * record_size :
  1123					       -EFAULT;
  1124				goto out;
  1125			}
  1126	
  1127			memcpy(&log_state->state, &next_state, sizeof(next_state));
  1128			total_reads_collected += reads_collected;
  1129			buf += reads_collected * record_size;
  1130			reads_to_collect -= reads_collected;
  1131		}
  1132	
  1133		result = total_reads_collected * record_size;
  1134		*ppos = 0;
  1135	out:
  1136		kfree(page);
  1137		return result;
  1138	}
  1139	

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

                 reply	other threads:[~2026-03-24  8:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202603241635.VXniY6dM-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.com \
    --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.