All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android12-5.10 1/2] drivers/staging/android/debug_kinfo.c:64:30: sparse: sparse: Using plain integer as NULL pointer
@ 2021-02-02 13:33 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-02-02 13:33 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2306 bytes --]

tree:   https://android.googlesource.com/kernel/common android12-5.10
head:   cf236c272d7f78ea744808012e3689489facfcbc
commit: e7be908f88dbde1df94db83d6c7a23b117de0f36 [1/2] ANDROID: staging: add debug-kinfo driver
config: arm-randconfig-s031-20210202 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-215-g0fb77bb6-dirty
        git remote add android-common https://android.googlesource.com/kernel/common
        git fetch --no-tags android-common android12-5.10
        git checkout e7be908f88dbde1df94db83d6c7a23b117de0f36
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


"sparse warnings: (new ones prefixed by >>)"
>> drivers/staging/android/debug_kinfo.c:64:30: sparse: sparse: Using plain integer as NULL pointer

vim +64 drivers/staging/android/debug_kinfo.c

    57	
    58	static int build_info_set(const char *str, const struct kernel_param *kp)
    59	{
    60		struct kernel_all_info *all_info;
    61		size_t build_info_size;
    62		int ret = 0;
    63	
  > 64		if (all_info_addr == 0 || all_info_size == 0) {
    65			ret = -EPERM;
    66			goto Exit;
    67		}
    68	
    69		all_info = (struct kernel_all_info *)all_info_addr;
    70		build_info_size = sizeof(all_info->info.build_info);
    71	
    72		memcpy(&all_info->info.build_info, str, min(build_info_size - 1, strlen(str)));
    73		update_kernel_all_info(all_info);
    74	
    75		if (strlen(str) > build_info_size) {
    76			pr_warn("%s: Build info buffer (len: %zd) can't hold entire string '%s'\n",
    77					__func__, build_info_size, str);
    78			ret = -ENOMEM;
    79		}
    80	
    81	Exit:
    82		vunmap(all_info_addr);
    83		return ret;
    84	}
    85	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31061 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [android-common:android12-5.10 1/2] drivers/staging/android/debug_kinfo.c:64:30: sparse: sparse: Using plain integer as NULL pointer
@ 2021-06-08  1:13 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-06-08  1:13 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2110 bytes --]

tree:   https://android.googlesource.com/kernel/common android12-5.10
head:   cf236c272d7f78ea744808012e3689489facfcbc
commit: e7be908f88dbde1df94db83d6c7a23b117de0f36 [1/2] ANDROID: staging: add debug-kinfo driver
config: i386-randconfig-s032-20210607 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        git remote add android-common https://android.googlesource.com/kernel/common
        git fetch --no-tags android-common android12-5.10
        git checkout e7be908f88dbde1df94db83d6c7a23b117de0f36
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/staging/android/debug_kinfo.c:64:30: sparse: sparse: Using plain integer as NULL pointer

vim +64 drivers/staging/android/debug_kinfo.c

    57	
    58	static int build_info_set(const char *str, const struct kernel_param *kp)
    59	{
    60		struct kernel_all_info *all_info;
    61		size_t build_info_size;
    62		int ret = 0;
    63	
  > 64		if (all_info_addr == 0 || all_info_size == 0) {
    65			ret = -EPERM;
    66			goto Exit;
    67		}
    68	
    69		all_info = (struct kernel_all_info *)all_info_addr;
    70		build_info_size = sizeof(all_info->info.build_info);
    71	
    72		memcpy(&all_info->info.build_info, str, min(build_info_size - 1, strlen(str)));
    73		update_kernel_all_info(all_info);
    74	
    75		if (strlen(str) > build_info_size) {
    76			pr_warn("%s: Build info buffer (len: %zd) can't hold entire string '%s'\n",
    77					__func__, build_info_size, str);
    78			ret = -ENOMEM;
    79		}
    80	
    81	Exit:
    82		vunmap(all_info_addr);
    83		return ret;
    84	}
    85	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30661 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-08  1:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 13:33 [android-common:android12-5.10 1/2] drivers/staging/android/debug_kinfo.c:64:30: sparse: sparse: Using plain integer as NULL pointer kernel test robot
2021-06-08  1:13 kernel test robot

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.