• Frank Li's avatar
    usb: cdns3: fix static checker warning. · 575dd7ec
    Frank Li authored
    The patch c450e48eb570: "usb: cdns3: add power lost support for
    system resume" from Feb 18, 2021, leads to the following static
    checker warning:
    
            drivers/usb/cdns3/core.c:551 cdns_resume()
            error: uninitialized symbol 'ret'.
    
    drivers/usb/cdns3/core.c
    544
    545     if (!role_changed) {
    546            if (cdns->role == USB_ROLE_HOST)
    547                  ret = cdns_drd_host_on(cdns);
    548     else if (cdns->role == USB_ROLE_DEVICE)
    549            ret = cdns_drd_gadget_on(cdns);
    
    "ret" is uninitialized at else branch.
    Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: default avatarFrank Li <frank.li@nxp.com>
    Signed-off-by: default avatarPeter Chen <peter.chen@kernel.org>
    575dd7ec
core.c 12.2 KB