mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 16:01:44 -04:00
i3c: mipi-i3c-hci: Stop reading Extended Capabilities if capability ID is 0
Extended Capability ID value 0 is special. It signifies the end of the list. Stop reading Extended Capabilities if capability ID is 0. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260106164416.67074-3-adrian.hunter@intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
committed by
Alexandre Belloni
parent
840688d8e6
commit
0818e4aa8f
@@ -271,7 +271,7 @@ int i3c_hci_parse_ext_caps(struct i3c_hci *hci)
|
||||
cap_length = FIELD_GET(CAP_HEADER_LENGTH, cap_header);
|
||||
dev_dbg(&hci->master.dev, "id=0x%02x length=%d",
|
||||
cap_id, cap_length);
|
||||
if (!cap_length)
|
||||
if (!cap_id || !cap_length)
|
||||
break;
|
||||
if (curr_cap + cap_length * 4 >= end) {
|
||||
dev_err(&hci->master.dev,
|
||||
|
||||
Reference in New Issue
Block a user