• Sebastian Ott's avatar
    [S390] cio: fix memleak in subchannel validation · ab6aae09
    Sebastian Ott authored
    When scanning for new subchannels we have a code path where we allocate
    memory for a struct subchannel, set the device name (which is dynamically
    allocated now) and do a check if the underlying device is blacklisted - if
    so we free the subchannel structure.
    Since we have not set up refcounting at this stage, the device name's memory
    is lost. Fix this by moving the dev_set_name after the blacklist test.
    
    Note: With this patch the init_name for the console subchannel becomes
    virtually obsolete.
    Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    ab6aae09
css.c 25.8 KB