From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7397132354670101025==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: [android-common:android-mainline 4/5] fs/incfs/data_mgmt.c:799:21: sparse: sparse: Using plain integer as NULL pointer Date: Thu, 19 Mar 2020 08:23:21 +0800 Message-ID: <202003190817.usWNrAN1%lkp@intel.com> List-Id: --===============7397132354670101025== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://android.googlesource.com/kernel/common android-mainline head: e94931cb2c0ec3992df6dfe452f2145fc5ad2c74 commit: bc6a70e849cccf3717e88833b98b592af32fad83 [4/5] ANDROID: Incremental= fs: Remove signature checks from kernel reproduce: # apt-get install sparse # sparse version: v0.6.1-180-g0558317d-dirty git checkout bc6a70e849cccf3717e88833b98b592af32fad83 make ARCH=3Dx86_64 allmodconfig make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot sparse warnings: (new ones prefixed by >>) >> fs/incfs/data_mgmt.c:799:21: sparse: sparse: Using plain integer as NULL= pointer -- >> fs/incfs/integrity.c:65:19: sparse: sparse: cast to restricted __le32 vim +799 fs/incfs/data_mgmt.c 790 = 791 static int process_file_signature_md(struct incfs_file_signature *sg, 792 struct metadata_handler *handler) 793 { 794 struct data_file *df =3D handler->context; 795 struct mtree *hash_tree =3D NULL; 796 int error =3D 0; 797 struct incfs_df_signature *signature =3D 798 kzalloc(sizeof(*signature), GFP_NOFS); > 799 void *buf =3D 0; 800 ssize_t read; 801 = 802 if (!df || !df->df_backing_file_context || 803 !df->df_backing_file_context->bc_file) { 804 error =3D -ENOENT; 805 goto out; 806 } 807 = 808 signature->hash_offset =3D le64_to_cpu(sg->sg_hash_tree_offset); 809 signature->hash_size =3D le32_to_cpu(sg->sg_hash_tree_size); 810 signature->sig_offset =3D le64_to_cpu(sg->sg_sig_offset); 811 signature->sig_size =3D le32_to_cpu(sg->sg_sig_size); 812 = 813 buf =3D kzalloc(signature->sig_size, GFP_NOFS); 814 if (!buf) { 815 error =3D -ENOMEM; 816 goto out; 817 } 818 = 819 read =3D incfs_kread(df->df_backing_file_context->bc_file, buf, 820 signature->sig_size, signature->sig_offset); 821 if (read < 0) { 822 error =3D read; 823 goto out; 824 } 825 = 826 if (read !=3D signature->sig_size) { 827 error =3D -EINVAL; 828 goto out; 829 } 830 = 831 hash_tree =3D incfs_alloc_mtree(range(buf, signature->sig_size), 832 df->df_block_count); 833 if (IS_ERR(hash_tree)) { 834 error =3D PTR_ERR(hash_tree); 835 hash_tree =3D NULL; 836 goto out; 837 } 838 if (hash_tree->hash_tree_area_size !=3D signature->hash_size) { 839 error =3D -EINVAL; 840 goto out; 841 } 842 if (signature->hash_size > 0 && 843 handler->md_record_offset <=3D signature->hash_offset) { 844 error =3D -EINVAL; 845 goto out; 846 } 847 if (handler->md_record_offset <=3D signature->sig_offset) { 848 error =3D -EINVAL; 849 goto out; 850 } 851 df->df_hash_tree =3D hash_tree; 852 hash_tree =3D NULL; 853 df->df_signature =3D signature; 854 signature =3D NULL; 855 out: 856 incfs_free_mtree(hash_tree); 857 kfree(signature); 858 kfree(buf); 859 = 860 return error; 861 } 862 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============7397132354670101025==--