tree:
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
head: 18956295fea61e6a08a15d829b06e744830ae236
commit: b32ac463cb59e758b4560260fd168a2b4ea6e81a [114/140] scsi: sg: NO_DXFER move to/from
kernel buffers
config: x86_64-randconfig-r015-20210308 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
cd9a69289c7825d54450cb6829fef2c8e0f1963a)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
#
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git/commit/?id=b...
git remote add mkp-scsi
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
git fetch --no-tags mkp-scsi for-next
git checkout b32ac463cb59e758b4560260fd168a2b4ea6e81a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/scsi/sg.c:2902:34: warning: variable 'k' is
uninitialized when used here [-Wuninitialized]
bio =
sg_mk_kern_bio(num_sgat - k);
^
drivers/scsi/sg.c:2889:7: note: initialize the variable 'k' to silence this
warning
int k, ln;
^
= 0
1 warning generated.
vim +/k +2902 drivers/scsi/sg.c
2878
2879 /*
2880 * Setup to move data between kernel buffers managed by this driver and a SCSI
device. Note that
2881 * there is no corresponding 'unmap' call as is required by
blk_rq_map_user() . Uses a single
2882 * bio with an expanded appended bvec if necessary.
2883 */
2884 static int
2885 sg_rq_map_kern(struct sg_request *srp, struct request_queue *q, struct request
*rqq, int rw_ind)
2886 {
2887 struct sg_scatter_hold *schp = &srp->sgat_h;
2888 struct bio *bio;
2889 int k, ln;
2890 int op_flags = 0;
2891 int num_sgat = schp->num_sgat;
2892 int dlen = schp->dlen;
2893 int pg_sz = 1 << (PAGE_SHIFT + schp->page_order);
2894 int num_segs = (1 << schp->page_order) * num_sgat;
2895 int res = 0;
2896
2897 SG_LOG(4, srp->parentfp, "%s: dlen=%d, pg_sz=%d\n", __func__, dlen,
pg_sz);
2898 if (num_sgat <= 0)
2899 return 0;
2900 if (rw_ind == WRITE)
2901 op_flags = REQ_SYNC | REQ_IDLE;
2902 bio = sg_mk_kern_bio(num_sgat - k);
2903 if (!bio)
2904 return -ENOMEM;
2905 bio->bi_opf = req_op(rqq) | op_flags;
2906
2907 for (k = 0; k < num_sgat && dlen > 0; ++k, dlen -= ln) {
2908 ln = min_t(int, dlen, pg_sz);
2909 if (bio_add_pc_page(q, bio, schp->pages[k], ln, 0) < ln) {
2910 bio_put(bio);
2911 return -EINVAL;
2912 }
2913 }
2914 res = blk_rq_append_bio(rqq, &bio);
2915 if (unlikely(res))
2916 bio_put(bio);
2917 else
2918 rqq->nr_phys_segments = num_segs;
2919 return res;
2920 }
2921
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org