Skip to contentSkip to conversation

usb: typec: ucsi: add Huawei Matebook E Go ucsi driver

bug report Dan Carpenter 2 participants 2 messages Apr 15, 2025 USB

lore
Share & tools
lore
#0 lore raw

Hello Pengyu Luo,

Commit 00327d7f2c8c ("usb: typec: ucsi: add Huawei Matebook E Go ucsi driver") from Mar 16, 2025 (linux-next), leads to the following Smatch static checker warning:

drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c:372 gaokun_ucsi_notify()
error: uninitialized symbol 'cci'.

drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c

    358 static int gaokun_ucsi_notify(struct notifier_block *nb,
    359                               unsigned long action, void *data)
    360 {
    361         u32 cci;
    362         struct gaokun_ucsi *uec = container_of(nb, struct gaokun_ucsi, nb);
    363 
    364         switch (action) {
    365         case EC_EVENT_USB:
    366                 gaokun_ucsi_complete_usb_ack(uec);
    367                 gaokun_ucsi_altmode_notify_ind(uec);
    368                 return NOTIFY_OK;
    369 
    370         case EC_EVENT_UCSI:
    371                 gaokun_ucsi_read_cci(uec->ucsi, &cci);
                                                        ^^^^

No error checking.

--> 372                 ucsi_notify_common(uec->ucsi, cci);
    373                 if (UCSI_CCI_CONNECTOR(cci))
    374                         gaokun_ucsi_handle_no_usb_event(uec, UCSI_CCI_CONNECTOR(cci) - 1);
    375 
    376                 return NOTIFY_OK;
    377 
    378         default:
    379                 return NOTIFY_DONE;
    380         }
    381 }

regards,
dan carpenter

#1 lore raw
Quoted 8 lines · Dan Carpenter

Hello Pengyu Luo,

Commit 00327d7f2c8c ("usb: typec: ucsi: add Huawei Matebook E Go ucsi driver") from Mar 16, 2025 (linux-next), leads to the following Smatch static checker warning:

drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c:372 gaokun_ucsi_notify()
error: uninitialized symbol 'cci'.

Hi, Dan. Thanks for pointing out it, I have sent the patch to fix it.
https://lore.kernel.org/linux-usb/[email protected]

Best wishes,
Pengyu