<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/mcb/mcb-parse.c, 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: 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>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: use symbol namespaces</title>
<updated>2019-11-03T18:54:53+00:00</updated>
<author>
<name>Johannes Thumshirn</name>
<email>jthumshirn@suse.de</email>
</author>
<published>2019-10-16T10:01:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=891e60368ba1840c1b8bbc72beb1da0dae289430'/>
<id>urn:sha1:891e60368ba1840c1b8bbc72beb1da0dae289430</id>
<content type='text'>
Now that we have symbol namespaces, use them in MCB to not pollute the
default namespace with MCB internals.

Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Jessica Yu &lt;jeyu@kernel.org&gt;
Reviewed-by: Michael Moese &lt;mmoese@suse.de&gt;
Link: https://lore.kernel.org/r/20191016100158.1400-1-jthumshirn@suse.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>treewide: Add SPDX license identifier for missed files</title>
<updated>2019-05-21T08:50:45+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-19T12:08:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=457c89965399115e5cd8bf38f9c597293405703d'/>
<id>urn:sha1:457c89965399115e5cd8bf38f9c597293405703d</id>
<content type='text'>
Add SPDX license identifiers to all files which:

 - Have no license information of any form

 - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
   initial scan/conversion to ignore the file

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mcb: Fix an error handling path in 'chameleon_parse_cells()'</title>
<updated>2017-08-31T16:49:41+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2017-08-29T12:47:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ec6bff199f27c85a37443a854f7c9f1a8c94a9d'/>
<id>urn:sha1:5ec6bff199f27c85a37443a854f7c9f1a8c94a9d</id>
<content type='text'>
If 'chameleon_get_bar()' fails, we will return 0, which mean success.
We should return the corresponding error code instead.

Remove the useless initialisation of 'ret' which was hiding the issue.
(if 'ret' is not set, gcc generates a warning ("warning: ‘ret’ may be used
uninitialized in this function"))

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mcb: fix compiler warning logical-op in mcb-parse.c</title>
<updated>2016-11-15T09:52:37+00:00</updated>
<author>
<name>Michael Moese</name>
<email>michael.moese@men.de</email>
</author>
<published>2016-11-15T09:36:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c836790ae55b854af0e95fce1349ef68f543b79b'/>
<id>urn:sha1:c836790ae55b854af0e95fce1349ef68f543b79b</id>
<content type='text'>
The expression was clearly wrong, the logical AND of expressions
must be changed to a logical OR.

Reported-by: David Binderman &lt;dcb314@hotmail.com&gt;
Signed-off-by: Michael Moese &lt;michael.moese@men.de&gt;
Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mcb: Added bar descriptor support for non PCI bus MCB carrier</title>
<updated>2016-08-31T11:16:24+00:00</updated>
<author>
<name>Andreas Werner</name>
<email>andreas.werner@men.de</email>
</author>
<published>2016-08-26T07:34:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ffc7bb3857e42acab131271e485735cbf673d0f0'/>
<id>urn:sha1:ffc7bb3857e42acab131271e485735cbf673d0f0</id>
<content type='text'>
Added support for the bar descriptor. This type is used for FPGAs
connect to the LPC or to a non PCI bus.

The Bar descriptor could have a maximum of 6 BARs. Each of the
devices within the FPGA could be mapped to a different BAR.
The BAR descriptor is comparable to the PCI header.

Signed-off-by: Andreas Werner &lt;andreas.werner@men.de&gt;
[ free bar descriptor in the non-error case ]
Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
