[pinchartl-media:rpi/next/bcm2835-isp 5/49] drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:130 get_kernel_id() warn: sleeping in atomic context
From: Dan Carpenter
Date: Thu Jan 13 2022 - 01:20:36 EST
tree: git://linuxtv.org/pinchartl/media.git rpi/next/bcm2835-isp
head: 97975aa0732da0e2084ed69d140656c2162bec05
commit: 0cfa42bcc0795e569f1312e6ef5843c97bd36642 [5/49] staging: vc04_services: Add new vc-sm-cma driver
config: arm-randconfig-m031-20220112 (https://download.01.org/0day-ci/archive/20220113/202201130306.YgzUxxgI-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
smatch warnings:
drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:130 get_kernel_id() warn: sleeping in atomic context
drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:1245 vc_sm_cma_ioctl_alloc() error: we previously assumed 'buffer' could be null (see line 1133)
vim +130 drivers/staging/vc04_services/vc-sm-cma/vc_sm.c
0cfa42bcc0795e Dave Stevenson 2020-10-08 125 static int get_kernel_id(struct vc_sm_buffer *buffer)
0cfa42bcc0795e Dave Stevenson 2020-10-08 126 {
0cfa42bcc0795e Dave Stevenson 2020-10-08 127 int handle;
0cfa42bcc0795e Dave Stevenson 2020-10-08 128
0cfa42bcc0795e Dave Stevenson 2020-10-08 129 spin_lock(&sm_state->kernelid_map_lock);
Takes lock
0cfa42bcc0795e Dave Stevenson 2020-10-08 @130 handle = idr_alloc(&sm_state->kernelid_map, buffer, 0, 0, GFP_KERNEL);
Presumably GFP_KERNEL can sleep. Use GFP_ATOMIC?
0cfa42bcc0795e Dave Stevenson 2020-10-08 131 spin_unlock(&sm_state->kernelid_map_lock);
0cfa42bcc0795e Dave Stevenson 2020-10-08 132
0cfa42bcc0795e Dave Stevenson 2020-10-08 133 return handle;
0cfa42bcc0795e Dave Stevenson 2020-10-08 134 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx