[bug report] staging: vchiq_arm: pass vchiq instance to 'handle_to_service'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Adrien Thierry,

This is a semi-automatic email about new static checker warnings.

The patch 6d02150cdf76: "staging: vchiq_arm: pass vchiq instance to 
'handle_to_service'" from May 18, 2022, leads to the following Smatch 
complaint:

    drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1070 service_callback()
    warn: variable dereferenced before check 'instance' (see line 1062)

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
  1061		rcu_read_lock();
  1062		service = handle_to_service(instance, handle);
                                            ^^^^^^^^
New dereference

  1063		if (WARN_ON(!service)) {
  1064			rcu_read_unlock();
  1065			return VCHIQ_SUCCESS;
  1066		}
  1067	
  1068		user_service = (struct user_service *)service->base.userdata;
  1069	
  1070		if (!instance || instance->closing) {
                     ^^^^^^^^
Existing code checked for NULL

  1071			rcu_read_unlock();
  1072			return VCHIQ_SUCCESS;

regards,
dan carpenter




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux