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:android17-6.18 1/1] fs/incfs/pseudo_files.c:1077:22: sparse: sparse: Using plain integer as NULL pointer
Date: Sun, 18 Oct 2026 17:47:58 +0200	[thread overview]
Message-ID: <202610181707.0Ub9AJXr-lkp@intel.com> (raw)

tree:   https://android.googlesource.com/kernel/common android17-6.18
head:   8a4809044467faad32878517d4d0d3dde2f64adb
commit: 1c1e9693cafba5487c7657f972caca570bb5eca6 [1/1] ANDROID: incremental-fs: Make work with 16k pages
config: arm-randconfig-r2304-20261018 (https://download.01.org/0day-ci/archive/20261018/202610181707.0Ub9AJXr-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.4.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261018/202610181707.0Ub9AJXr-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/202610181707.0Ub9AJXr-lkp@intel.com/

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

vim +1077 fs/incfs/pseudo_files.c

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

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

                 reply	other threads:[~2026-10-18 15:48 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=202610181707.0Ub9AJXr-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.