diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-09-11 10:28:24 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-09-11 10:29:39 +0200 |
commit | ab6aae09024be1b039df441fa1b64dbe092d0acb (patch) | |
tree | 92f2d8612665b7c8257c48b61de7bce850012556 /drivers/s390/cio/cio.c | |
parent | f014824ee72e66292c3b1172dc142f959b42e61b (diff) | |
download | op-kernel-dev-ab6aae09024be1b039df441fa1b64dbe092d0acb.zip op-kernel-dev-ab6aae09024be1b039df441fa1b64dbe092d0acb.tar.gz |
[S390] cio: fix memleak in subchannel validation
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: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/cio.c')
-rw-r--r-- | drivers/s390/cio/cio.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 390b4e9..fe18ef6 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c @@ -564,11 +564,6 @@ int cio_validate_subchannel(struct subchannel *sch, struct subchannel_id schid) goto out; } mutex_init(&sch->reg_mutex); - /* Set a name for the subchannel */ - if (cio_is_console(schid)) - sch->dev.init_name = cio_get_console_sch_name(schid); - else - dev_set_name(&sch->dev, "0.%x.%04x", schid.ssid, schid.sch_no); /* * The first subchannel that is not-operational (ccode==3) |