[bug report] staging: vc04: Convert vchiq_log_error() to use dynamic debug

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

 



Hello Umang Jain,

The patch 1d8915cf8899: "staging: vc04: Convert vchiq_log_error() to
use dynamic debug" from Oct 24, 2023 (linux-next), leads to the
following Smatch static checker warning:

	drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:690 vchiq_initialise()
	error: we previously assumed 'state' could be null (see line 685)

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
    680          * It may never be ready if kernel and firmware are mismatched,so don't
    681          * block forever.
    682          */
    683         for (i = 0; i < VCHIQ_INIT_RETRIES; i++) {
    684                 state = vchiq_get_state();

state is set here.

    685                 if (state)
    686                         break;
    687                 usleep_range(500, 600);
    688         }
    689         if (i == VCHIQ_INIT_RETRIES) {
--> 690                 vchiq_log_error(state->dev, VCHIQ_CORE, "%s: videocore not initialized\n",

If i == VCHIQ_INIT_RETRIES that means state is NULL.

    691                                 __func__);
    692                 ret = -ENOTCONN;
    693                 goto failed;
    694         } else if (i > 0) {
    695                 vchiq_log_warning(state->dev, VCHIQ_CORE,
    696                                   "%s: videocore initialized after %d retries\n", __func__, i);
    697         }
    698 
    699         instance = kzalloc(sizeof(*instance), GFP_KERNEL);

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