s390/cio: fix measurement characteristics memleak
Measurement characteristics are allocated during channel path registration but not freed during deregistration. Fix this by embedding these characteristics inside struct channel_path. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:

committed by
Martin Schwidefsky

parent
d8f51227f3
commit
0d9bfe9123
@@ -139,11 +139,11 @@ static ssize_t chp_measurement_chars_read(struct file *filp,
|
||||
|
||||
device = container_of(kobj, struct device, kobj);
|
||||
chp = to_channelpath(device);
|
||||
if (!chp->cmg_chars)
|
||||
if (chp->cmg == -1)
|
||||
return 0;
|
||||
|
||||
return memory_read_from_buffer(buf, count, &off,
|
||||
chp->cmg_chars, sizeof(struct cmg_chars));
|
||||
return memory_read_from_buffer(buf, count, &off, &chp->cmg_chars,
|
||||
sizeof(chp->cmg_chars));
|
||||
}
|
||||
|
||||
static struct bin_attribute chp_measurement_chars_attr = {
|
||||
|
Reference in New Issue
Block a user