<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/mcb, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-05-02T05:50:47+00:00</updated>
<entry>
<title>mcb: fix a double free bug in chameleon_parse_gdd()</title>
<updated>2025-05-02T05:50:47+00:00</updated>
<author>
<name>Haoxiang Li</name>
<email>haoxiang_li2024@163.com</email>
</author>
<published>2025-03-10T08:46:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96838eb1836fd372e42be5db84f0b333b65146a6'/>
<id>urn:sha1:96838eb1836fd372e42be5db84f0b333b65146a6</id>
<content type='text'>
commit 7c7f1bfdb2249f854a736d9b79778c7e5a29a150 upstream.

In chameleon_parse_gdd(), if mcb_device_register() fails, 'mdev'
would be released in mcb_device_register() via put_device().
Thus, goto 'err' label and free 'mdev' again causes a double free.
Just return if mcb_device_register() fails.

Fixes: 3764e82e5150 ("drivers: Introduce MEN Chameleon Bus")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Haoxiang Li &lt;haoxiang_li2024@163.com&gt;
Signed-off-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Link: https://lore.kernel.org/r/6201d09e2975ae5789879f79a6de4c38de9edd4a.1741596225.git.jth@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mcb: fix error handling for different scenarios when parsing</title>
<updated>2023-11-28T17:20:05+00:00</updated>
<author>
<name>Sanjuán García, Jorge</name>
<email>Jorge.SanjuanGarcia@duagon.com</email>
</author>
<published>2023-10-19T14:15:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=07f2f69f0b82578da6bda5f10320ddfe0be43d96'/>
<id>urn:sha1:07f2f69f0b82578da6bda5f10320ddfe0be43d96</id>
<content type='text'>
commit 63ba2d07b4be72b94216d20561f43e1150b25d98 upstream.

chameleon_parse_gdd() may fail for different reasons and end up
in the err tag. Make sure we at least always free the mcb_device
allocated with mcb_alloc_dev().

If mcb_device_register() fails, make sure to give up the reference
in the same place the device was added.

Fixes: 728ac3389296 ("mcb: mcb-parse: fix error handing in chameleon_parse_gdd()")
Cc: stable &lt;stable@kernel.org&gt;
Reviewed-by: Jose Javier Rodriguez Barbarin &lt;JoseJavier.Rodriguez@duagon.com&gt;
Signed-off-by: Jorge Sanjuan Garcia &lt;jorge.sanjuangarcia@duagon.com&gt;
Link: https://lore.kernel.org/r/20231019141434.57971-2-jorge.sanjuangarcia@duagon.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mcb: remove is_added flag from mcb_device struct</title>
<updated>2023-10-05T07:50:14+00:00</updated>
<author>
<name>Jorge Sanjuan Garcia</name>
<email>jorge.sanjuangarcia@duagon.com</email>
</author>
<published>2023-09-06T11:49:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0f28ada1fbf0054557cddcdb93ad17f767105208'/>
<id>urn:sha1:0f28ada1fbf0054557cddcdb93ad17f767105208</id>
<content type='text'>
When calling mcb_bus_add_devices(), both mcb devices and the mcb
bus will attempt to attach a device to a driver because they share
the same bus_type. This causes an issue when trying to cast the
container of the device to mcb_device struct using to_mcb_device(),
leading to a wrong cast when the mcb_bus is added. A crash occurs
when freing the ida resources as the bus numbering of mcb_bus gets
confused with the is_added flag on the mcb_device struct.

The only reason for this cast was to keep an is_added flag on the
mcb_device struct that does not seem necessary. The function
device_attach() handles already bound devices and the mcb subsystem
does nothing special with this is_added flag so remove it completely.

Fixes: 18d288198099 ("mcb: Correctly initialize the bus's device")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Jorge Sanjuan Garcia &lt;jorge.sanjuangarcia@duagon.com&gt;
Co-developed-by: Jose Javier Rodriguez Barbarin &lt;JoseJavier.Rodriguez@duagon.com&gt;
Signed-off-by: Jose Javier Rodriguez Barbarin &lt;JoseJavier.Rodriguez@duagon.com&gt;
Link: https://lore.kernel.org/r/20230906114901.63174-2-JoseJavier.Rodriguez@duagon.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mcb-lpc: Reallocate memory region to avoid memory overlapping</title>
<updated>2023-04-20T12:24:01+00:00</updated>
<author>
<name>Rodríguez Barbarin, José Javier</name>
<email>JoseJavier.Rodriguez@duagon.com</email>
</author>
<published>2023-04-11T08:33:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2025b2ca8004c04861903d076c67a73a0ec6dfca'/>
<id>urn:sha1:2025b2ca8004c04861903d076c67a73a0ec6dfca</id>
<content type='text'>
mcb-lpc requests a fixed-size memory region to parse the chameleon
table, however, if the chameleon table is smaller that the allocated
region, it could overlap with the IP Cores' memory regions.

After parsing the chameleon table, drop/reallocate the memory region
with the actual chameleon table size.

Co-developed-by: Jorge Sanjuan Garcia &lt;jorge.sanjuangarcia@duagon.com&gt;
Signed-off-by: Jorge Sanjuan Garcia &lt;jorge.sanjuangarcia@duagon.com&gt;
Signed-off-by: Javier Rodriguez &lt;josejavier.rodriguez@duagon.com&gt;
Signed-off-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Link: https://lore.kernel.org/r/20230411083329.4506-4-jth@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mcb-pci: Reallocate memory region to avoid memory overlapping</title>
<updated>2023-04-20T12:24:01+00:00</updated>
<author>
<name>Rodríguez Barbarin, José Javier</name>
<email>JoseJavier.Rodriguez@duagon.com</email>
</author>
<published>2023-04-11T08:33:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9be24faadd085c284890c3afcec7a0184642315a'/>
<id>urn:sha1:9be24faadd085c284890c3afcec7a0184642315a</id>
<content type='text'>
mcb-pci requests a fixed-size memory region to parse the chameleon
table, however, if the chameleon table is smaller that the allocated
region, it could overlap with the IP Cores' memory regions.

After parsing the chameleon table, drop/reallocate the memory region
with the actual chameleon table size.

Co-developed-by: Jorge Sanjuan Garcia &lt;jorge.sanjuangarcia@duagon.com&gt;
Signed-off-by: Jorge Sanjuan Garcia &lt;jorge.sanjuangarcia@duagon.com&gt;
Signed-off-by: Javier Rodriguez &lt;josejavier.rodriguez@duagon.com&gt;
Signed-off-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Link: https://lore.kernel.org/r/20230411083329.4506-3-jth@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mcb: Return actual parsed size when reading chameleon table</title>
<updated>2023-04-20T12:24:01+00:00</updated>
<author>
<name>Rodríguez Barbarin, José Javier</name>
<email>JoseJavier.Rodriguez@duagon.com</email>
</author>
<published>2023-04-11T08:33:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a889c276d33d333ae96697510f33533f6e9d9591'/>
<id>urn:sha1:a889c276d33d333ae96697510f33533f6e9d9591</id>
<content type='text'>
The function chameleon_parse_cells() returns the number of cells
parsed which has an undetermined size. This return value is only
used for error checking but the number of cells is never used.

Change return value to be number of bytes parsed to allow for
memory management improvements.

Co-developed-by: Jorge Sanjuan Garcia &lt;jorge.sanjuangarcia@duagon.com&gt;
Signed-off-by: Jorge Sanjuan Garcia &lt;jorge.sanjuangarcia@duagon.com&gt;
Signed-off-by: Javier Rodriguez &lt;josejavier.rodriguez@duagon.com&gt;
Signed-off-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Link: https://lore.kernel.org/r/20230411083329.4506-2-jth@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: make struct bus_type.uevent() take a const *</title>
<updated>2023-01-27T12:45:52+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2023-01-11T11:30:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2a81ada32f0e584fc0c943e0d3a8c9f4fae411d6'/>
<id>urn:sha1:2a81ada32f0e584fc0c943e0d3a8c9f4fae411d6</id>
<content type='text'>
The uevent() callback in struct bus_type should not be modifying the
device that is passed into it, so mark it as a const * and propagate the
function signature changes out into all relevant subsystems that use
this callback.

Acked-by: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Acked-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20230111113018.459199-16-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mcb: mcb-parse: fix error handing in chameleon_parse_gdd()</title>
<updated>2022-12-02T16:48:04+00:00</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2022-12-02T09:38:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=728ac3389296caf68638628c987aeae6c8851e2d'/>
<id>urn:sha1:728ac3389296caf68638628c987aeae6c8851e2d</id>
<content type='text'>
If mcb_device_register() returns error in chameleon_parse_gdd(), the refcount
of bus and device name are leaked. Fix this by calling put_device() to give up
the reference, so they can be released in mcb_release_dev() and kobject_cleanup().

Fixes: 3764e82e5150 ("drivers: Introduce MEN Chameleon Bus")
Reviewed-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Signed-off-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Link: https://lore.kernel.org/r/ebfb06e39b19272f0197fa9136b5e4b6f34ad732.1669624063.git.johannes.thumshirn@wdc.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: mcb: fix resource leak in mcb_probe()</title>
<updated>2022-12-02T16:48:04+00:00</updated>
<author>
<name>Zhengchao Shao</name>
<email>shaozhengchao@huawei.com</email>
</author>
<published>2022-12-02T09:38:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d7237462561fcd224fa687c56ccb68629f50fc0d'/>
<id>urn:sha1:d7237462561fcd224fa687c56ccb68629f50fc0d</id>
<content type='text'>
When probe hook function failed in mcb_probe(), it doesn't put the device.
Compiled test only.

Fixes: 7bc364097a89 ("mcb: Acquire reference to device in probe")
Signed-off-by: Zhengchao Shao &lt;shaozhengchao@huawei.com&gt;
Signed-off-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Link: https://lore.kernel.org/r/9f87de36bfb85158b506cb78c6fc9db3f6a3bad1.1669624063.git.johannes.thumshirn@wdc.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: mcb: directly use ida_alloc()/free()</title>
<updated>2022-07-12T07:04:55+00:00</updated>
<author>
<name>keliu</name>
<email>liuke94@huawei.com</email>
</author>
<published>2022-07-12T06:50:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3af0b1d34a07f89651b4a37295da34a3dd3f2e79'/>
<id>urn:sha1:3af0b1d34a07f89651b4a37295da34a3dd3f2e79</id>
<content type='text'>
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .

Signed-off-by: keliu &lt;liuke94@huawei.com&gt;
Signed-off-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Link: https://lore.kernel.org/r/480676bee970da16bf1fa8565277240014395ba3.1657607743.git.johannes.thumshirn@wdc.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
